phaser3-nineslice icon indicating copy to clipboard operation
phaser3-nineslice copied to clipboard

Nine Slice game object collision with Phaser version 3.60 and greater

Open scottwestover opened this issue 1 year ago • 0 comments

In the latest version of Phaser 3, 3.60, the library introduced a new native Nine Slice Game Object: Nine Slice Game Object. This new game object uses the same factory name that is used by this library, nineslice.

Example code:

const nine = this.add.nineslice(400, 300, 'buttons', 'blue-box', 600, 400, 16, 16, 32, 16);

When you try to use this plugin with the latest version of Phaser 3 (3.60.0), you are not able to create a new nine slice game object with the game object factory in this plugin, since the Phaser 3 library will attempt to use the built in game object factory, and you will get an error similar to this in the developer console:

Texture "__MISSING" has no frame "50"
Screen Shot 2023-08-06 at 9 21 58 PM

The new Phaser 3 Nine Slice Game Object only works when you target the WEBGL mode of Phaser, and there is no support for the CANVAS mode of Phaser.


Example to reproduce the issue: replit

Note: in the index.html file, if you switch from Phaser 3.60.0 to 3.55.2, you will see that the plugin works without any issues.

scottwestover avatar Aug 07 '23 01:08 scottwestover