I’m not sure if this is a bug, but I use scene.add to create a container then give it a geometry mask and it works. I then scene.add a second container and add my first container to it.
It appears the mask I assigned my first container is no longer working. Neither containers have their positions changed during this creation phase, and both containers are positioned at [0, 0]. The mask is just a graphics object which I use fillRect to create the shape.
Does Phaser 3 support masks on nested containers, because it seems like that’s not the case?
Containers can have masks set on them and can be used as a mask too. However, Container children cannot be masked. The masks do not ‘stack up’. Only a Container on the root of the display list will use its mask.
So please correct me if I am wrong, but Phaser does NOT support masking on nested elements in a container? How do we implement a dialog box with scrollable content without mask? I really do not wish to mix DOM with canvas…
Yes, Phaser 3 does not currently support masks on nested objects within a container. This makes it very difficult, if not near impossible to structure and manage things like carousels, scroll bars, etc without using third party libraries.
EDIT: I seem to be mistaken.
It seems the functionality for nested masks has been added.