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
36.95k stars 7.08k forks source link

`createBitmapMask()` is inconsistent when used on Shapes #5976

Closed samme closed 1 year ago

samme commented 2 years ago

Version

Description

When called on a Shape game object, createBitmapMask(shape) makes a working mask but createBitmapMask() doesn't.

Example Test Code

Given a Shape:

const rect = this.add.rectangle(0, 0, 200, 150, 0xffff00);

This makes a working mask:

const mask = rect.createBitmapMask(rect);

This doesn't:

const mask = rect.createBitmapMask();

Both calls succeed, but only the first mask has a visual effect.

photonstorm commented 1 year ago

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.