Quick Menu

Description

1
<quick-menu></quick-menu>
Copied!
The quick menu is the small menu rendered in the bottom of the screen, or on the top if you're in mobile. It's a menu that allows access to certain features during the game such as saving, loading, showing the log etc. The quick menu will render each of the buttons it has on its global configuration

Configuration

Buttons

Methods

Add Button

1
static addButton ({ string, icon, data, ... }): void
Copied!
Adds a button to the end of the menu.
Example
1
monogatari.component ('quick-menu').addButton ({
2
string: 'Stats',
3
icon: 'fas fa-tasks',
4
data: {
5
action: 'show-stats'
6
}
7
});
Copied!

Add Button After

1
static addButtonAfter (after: string, { string, icon, data, ... }): void
Copied!
Adds a button immediately after the button that has the string specified in the after argument.
Example
The following sample will add the button after the Back button
1
monogatari.component ('quick-menu').addButtonAfter ('Back', {
2
string: 'Stats',
3
icon: 'fas fa-tasks',
4
data: {
5
action: 'show-stats'
6
}
7
});
Copied!

Add Button Before

1
static addButtonBefore (before: string, { string, icon, data, ... }): void
Copied!
Adds a button immediately before the button that has the string specified in the before argument.
Example
The following sample will add the button before the Back button
1
monogatari.component ('quick-menu').addButtonBefore ('Back', {
2
string: 'Stats',
3
icon: 'fas fa-tasks',
4
data: {
5
action: 'show-stats'
6
}
7
});
Copied!

Remove Button

The following sample will remove the "Hide" button.
1
monogatari.component ('quick-menu').removeButton ('Hide');
Copied!
Last modified 4mo ago