phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
37.09k stars 7.1k forks source link

Mask and masked game objects in container #6177

Open rexrainbow opened 2 years ago

rexrainbow commented 2 years ago

Version

Description

Here is the test code. There are two game objects, a Graphics game object to create mask, apply this mask to another image game object.

I guess that mask will be applied in world position/scale/angle, not local position/scale/angle of container. So mask source game object (Graphics game object, in this case) ought to set position/scale/angle from container to world, under render method, then reverse these properties back.

photonstorm commented 1 year ago

This issue has been mentioned on Phaser. There might be relevant details there:

https://phaser.discourse.group/t/moving-mask-in-container-issue/5095/7

DanLCD commented 1 year ago

Any progress on this? It's still present on 3.60

woshisheji commented 1 year ago

如果条件允许的话,我觉得把mask部分的组件用官方容器重构一下应该就可以了。