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?
this.container1 = this.add.container(); this.container1.add(this.add.image(100, 100, "Gems0001")); // this.make.image doesn't seem to work const maskShape = this.make.graphics(); maskShape.fillStyle(0xffffff, 1); maskShape.fillRect(100, 100, 50, 50); this.container1.mask = new Phaser.Display.Masks.GeometryMask(this, maskShape); this.container2 = this.add.container(); this.container2.add(this.container1);