You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Applying a BitmapMask in a game that uses the FIT scale mode and sets game size manually (to handle DPR scaling on mobile) no longer works correctly as of 3.60.0-beta.19. Any texture that a BitmapMask is applied to appears to scale and transform based on the manually set game size (game size * DPR) and not the final game size the FIT scaling mode enforces to stay within the window.
Functioning correctly, the demo should display a large grey square in the middle of the canvas being masked by a red stripe through the middle. This can be seen by setting the Phaser dependency to https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser.min.js or earlier. Using any dependency of 3.60.0-beta.19 or later causes the grey square to scale and transform as if the canvas was larger, but the mask texture to remain in the correct spot and still mask off parts of the grey square as if it was correctly placed.
Additional Information
I've set the game size scaling in the demo to be 1.5, but this affects any scaling above 1.
Rescaling textures or masks to account for this new behaviour cannot resolve the issue, it's challenging to demonstrate in a codepen but the cropping functionality of the mask (the section clipped out) cannot be scaled in any way I can find. This makes masks of complex shapes no longer viable. Neither scaling the original texture used to create the mask, nor the masked texture itself seems to affect this.
The text was updated successfully, but these errors were encountered:
Thanks for opening this, but it's a duplicate of #6527 (which itself is sort of a duplicate of #6503) so am tagging them here for completeness, but closing this as it needs tracking in the older issue.
Version
Description
Applying a BitmapMask in a game that uses the FIT scale mode and sets game size manually (to handle DPR scaling on mobile) no longer works correctly as of 3.60.0-beta.19. Any texture that a BitmapMask is applied to appears to scale and transform based on the manually set game size (game size * DPR) and not the final game size the FIT scaling mode enforces to stay within the window.
Example Test Code
https://codepen.io/crockergd/pen/abQmyvL
Functioning correctly, the demo should display a large grey square in the middle of the canvas being masked by a red stripe through the middle. This can be seen by setting the Phaser dependency to https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser.min.js or earlier. Using any dependency of 3.60.0-beta.19 or later causes the grey square to scale and transform as if the canvas was larger, but the mask texture to remain in the correct spot and still mask off parts of the grey square as if it was correctly placed.
Additional Information
I've set the game size scaling in the demo to be 1.5, but this affects any scaling above 1.
Rescaling textures or masks to account for this new behaviour cannot resolve the issue, it's challenging to demonstrate in a codepen but the cropping functionality of the mask (the section clipped out) cannot be scaled in any way I can find. This makes masks of complex shapes no longer viable. Neither scaling the original texture used to create the mask, nor the masked texture itself seems to affect this.
The text was updated successfully, but these errors were encountered: