dacha
    Preparing search index...

    Class UIBridge

    Loads your game interface and runs it together with the game.

    Pass a loader with UIBridge.with({ loadUI }). The loader returns a module with onInit and onDestroy, see LoadUIFn. The system calls onInit with a UIContext when the world is ready, and onDestroy when the world is destroyed.

    To give the interface settings, extend the class and declare fields with DefineField. You edit them in the system's settings, and the interface reads them from UIContext.options.

    const engine = new Engine({
    config,
    systems: [
    UIBridge.with({ loadUI: () => import('./ui') }),
    ...gameSystems,
    ],
    components: [...gameComponents],
    assets: [],
    });
    @DefineSystem({ name: 'GameUI' })
    export default class GameUI extends UIBridge {
    @DefineField({ type: 'scene' })
    mainMenu = '';
    }

    Game UI

    Hierarchy (View Summary)

    Index
    systemName: string

    The name the configuration uses for the system.

    DefineSystem sets it, so a game usually does not assign it.