Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

NinePatch is not defined #32

Open
DannyT opened this issue Dec 18, 2019 · 2 comments
Open

NinePatch is not defined #32

DannyT opened this issue Dec 18, 2019 · 2 comments

Comments

@DannyT
Copy link

DannyT commented Dec 18, 2019

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?

@jonchun
Copy link

jonchun commented Jan 19, 2020

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

@DannyT
Copy link
Author

DannyT commented Feb 2, 2020

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants