Skip to main content

Menu

Library allowing game developers to implement custom main menus for their games. These functions can be used for building game and addon selection UIs, and for loading into a game.

In most cases you won't need to build a game selection UI as the player will have already chosen your game from the engine's launcher menu.

Functions

Flags to the engine that the selected game and addons should be loaded at the end of this tick.

Menu.loadGame()

Functions - Addons

Lists all installed addons along with their metadata.

Menu.listAddons(): PackageMetadata[]

Returns

NameTypeDescription
addonsPackageMetadata[]List of addons.

Selects an addon by its unique slug, to load when calling loadGame.

Menu.selectAddon(addon: string)

Parameters

NameTypeDefault ValueDescription
addonstringRequiredUnique slug of the addon to select.

Deselects an addon by its unique slug, to prevent loading when calling loadGame.

Menu.deselectAddon(addon: string)

Parameters

NameTypeDefault ValueDescription
addonstringRequiredUnique slug of the addon to deselect.

Functions - Games

Lists all installed games along with their metadata.

Menu.listGames(): PackageMetadata[]

Returns

NameTypeDescription
gamesPackageMetadata[]List of games.

Selects a game by its unique slug, to load when calling loadGame.

Menu.selectGame(game: string)

Parameters

NameTypeDefault ValueDescription
gamestringRequiredUnique slug of the game to select.

Deselects the selected game if one is selected.

Menu.deselectGame()

Types

PackageMetadata

Metadata for a game or addon, collectively referred to as a 'package'.

type PackageMetadata = { folder: string, slug: string, name: string, mountPath: string, coverImagePath: string }

Properties

FieldTypeDescription
folderstringReal system path to the package's contents.
slugstringUnique slug identifying this package.
namestringDisplay name of the package.
mountPathstringVirtual filesystem path where the content will be mounted.
coverImagePathstringPath to a cover image. If the image can't be found, a suitable placeholder should be used.