dacha
    Preparing search index...

    Interface UIContext<O>

    What onInit of the interface module receives: the running game, as the interface needs it.

    Type Parameters

    • O = Record<string, unknown>

      The options of the bridge class, see UIContext.options.

    Index
    assets: Assets

    The project assets.

    options: O

    The values of the fields a class that extends UIBridge declares with DefineField, by field name.

    scene: Scene | undefined

    The active scene, or undefined between scenes. To follow it, use watch(({ scene }) => scene).

    world: World

    The world.

    • Follows a value of the game. The bridge evaluates selector every frame while the value has listeners, and reports it when it changes.

      Type Parameters

      • T

      Parameters

      • selector: (tools: UISelectorTools) => T

        Reads the value.

      • Optionalequals: (a: T, b: T) => boolean

        Compares two values. By default values are compared with Object.is, and two arrays are equal when their items are.

      Returns UIValue<T>

      The value to read and follow.