phaser3-ninepatch-plugin icon indicating copy to clipboard operation
phaser3-ninepatch-plugin copied to clipboard

NinePatch is not defined

Open DannyT opened this issue 5 years ago • 2 comments

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?

DannyT avatar Dec 18 '19 23:12 DannyT

This is how I do it: import { NinePatchPlugin, NinePatch } from "@koreez/phaser3-ninepatch";

jonchun avatar Jan 19 '20 14:01 jonchun

@Jonchun thanks, can you also share what your plugins config looks like?

DannyT avatar Feb 02 '20 10:02 DannyT