Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

can't add "Panel" #35

Open
cipsicko opened this issue Nov 23, 2018 · 0 comments
Open

can't add "Panel" #35

cipsicko opened this issue Nov 23, 2018 · 0 comments

Comments

@cipsicko
Copy link

Hi,

this is a piece of my code.

//== PRELOAD STATE
...
preload() {
        //== SlickUi
        slickUI = Game.plugins.add(Phaser.Plugin.SlickUI);
        slickUI.load(kenney.json');
    }
...
//**
   * MENU STATE
   *  the "Preload State" call the "Menu State" where i create the "Panel" element.  
   * "_G.SLICKUI" is a global variable
*/
...
create() {
        let panel;
        console.log(SlickUI.Element); // ==> 'Undefined'
        _G.SLICKUI.add(panel = SlickUI.Element.Panel(8, 8, 150, 16)); // ==> Cannot read property 'Panel' of undefined
}
...

I can't figure out how to solve it.
If call SlickUI.Element.Panel in the console it returns a function (so it should work), but return Undefined if called inside create() method

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

No branches or pull requests

1 participant