Closed jonathanhollander closed 7 years ago
Thanks for the report, Jonathan! I'll look into it when I'm back from my vacation.
Okay, the reason for the problem is that the mask has the wrong size. If a mask is not part of the display list, it's regarded as being in the local coordinate system of the object that's being masked. In your case, you scale the _bg
object up, and then give the mask the same size. If you set the mask size to _bg.texture.width/height
instead, it will work.
Or, alternatively, simply add _mask
to the display list via this.addChild(_mask)
. Then the two objects will be in the same coordinate system, and your code will yield the right result.
If that doesn't solve the issue, feel free to re-open it, of course. ;-)
I've found a weird result when trying to implement a rounded rectangle as a mask.
Here is more information about it: https://forum.starling-framework.org/topic/rounded-rectangle-mask