I'm trying to use the constructor method as per the readme:
//Add an nineslice image with an texture atlas
var ninePatch = new NinePatch(
this, // Phaser.Scene
150, // x position
100, // y position
200, // expected width
100, // expected height
"buttons", // atlas key
"btn_clean.png", // Image frame
{
top: 20, // Amount of pixels for top
bottom: 23, // Amount of pixels for bottom
left: 27, // Amount of pixels for left
right: 28 // Amount of pixels for right
}
);
this.add.existing(ninePatch);
However I'm getting NinePatch is not defined.
The this.make and this.add methods work fine so I'm assuming I need to import the class somewhere or similar?
I'm trying to use the constructor method as per the readme:
However I'm getting
NinePatch is not defined
.The
this.make
andthis.add
methods work fine so I'm assuming I need to import the class somewhere or similar?