Class: MenuManager

MenuManager


Source:

Methods


addMenu(menuName, callback)

Adds a function to the given menu

Parameters:
Name Type Description
menuName string
callback function
Source:
Example
myMod.menu.addMenu('myMenu', function () {
    let menu = this.menu;

    menu.create(0, 0, 'HouseBackground').setOrigin(0);

    menu.create(20, 1060, 'exit')
        .setOrigin(0, 1)
        .button()
        .on('pointerup', () =>{
            this.closeMenu();
        });)
}

closeMenu()

Closes the currently opened menu

Source:

getMenu(menuName)

Returns the function of the given menu

Parameters:
Name Type Description
menuName string
Source:
Returns:
Type
boolean | function

newDay(boolean)

If you want to progress to a new day after the menu closes

Parameters:
Name Type Description
boolean boolean
Source:

openMenu(menuName)

Starts the menu scene and opens the given menu

Parameters:
Name Type Description
menuName
Source:
Returns:
Type
Promise.<any>

removeMenu(menuName)

Parameters:
Name Type Description
menuName string
Source:

switchMenu(menuName)

Parameters:
Name Type Description
menuName string
Source: