@@ -596,6 +596,14 @@ export default class TMXTileMap {
596596 // propagate group blend mode to children (if not default)
597597 if ( group . blendMode !== "normal" && obj . blendMode === "normal" ) {
598598 obj . blendMode = group . blendMode ;
599+ // also propagate to child renderables (e.g. Entity wrappers)
600+ if (
601+ typeof obj . renderable !== "undefined" &&
602+ obj . renderable . isRenderable === true &&
603+ obj . renderable . blendMode === "normal"
604+ ) {
605+ obj . renderable . blendMode = group . blendMode ;
606+ }
599607 }
600608 obj . setOpacity ( obj . getOpacity ( ) * group . opacity ) ;
601609 // and to child renderables if any
@@ -611,6 +619,22 @@ export default class TMXTileMap {
611619 // directly add the obj into the objects array
612620 objects . push ( obj ) ;
613621 } /* false*/ else {
622+ // propagate group blend mode to children in non-flattened mode,
623+ // since container blendMode is overridden by each child's preDraw()
624+ if (
625+ group . blendMode !== "normal" &&
626+ obj . isRenderable === true &&
627+ obj . blendMode === "normal"
628+ ) {
629+ obj . blendMode = group . blendMode ;
630+ if (
631+ typeof obj . renderable !== "undefined" &&
632+ obj . renderable . isRenderable === true &&
633+ obj . renderable . blendMode === "normal"
634+ ) {
635+ obj . renderable . blendMode = group . blendMode ;
636+ }
637+ }
614638 // add it to the new container
615639 targetContainer . addChild ( obj ) ;
616640 }
0 commit comments