Skip to content

can't add "Panel" #35

@cipsicko

Description

@cipsicko

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions