Hierarchy

  • ReactBasedUiSystem

Methods

  • Add a UI renderer associated with an entity. The UI will be automatically cleaned up when the entity is removed from the engine.

    If a renderer is already associated with the given entity, it will be replaced.

    This allows dynamically adding UI Renderers that are rendered alongside the main UI set via setUiRenderer().

    Parameters

    • entity: Entity

      The entity to associate with this UI renderer. When the entity is removed, the UI renderer is automatically cleaned up.

    • ui: UiComponent

      The UI component to render

    • Optional options: UiRendererOptions

      Optional virtual size used for UI scale factor when main UI has none. Defaults and the mobile 16:9 override behave as in setUiRenderer. screenInset is honored per renderer, independently of the main UI's value, and defaults to 'device' here too.

    Returns void

  • Destroy all UI entities and unregister related systems.

    Returns void

  • Remove a previously added UI renderer by its associated entity. It does not affect the main UI renderer.

    Parameters

    • entity: Entity

      The entity whose UI renderer should be removed

    Returns void

  • Set the main UI renderer. Optional virtual size defines the global UI scale factor.

    When no virtual size is provided, a platform default is used: 1600x720 on mobile, 1920x1080 otherwise. Providing an invalid size (values <= 0) disables the virtual screen (no UI scaling). On mobile, a provided 16:9 virtual size is overridden to 1600x720 to fit phone screens.

    The optional screenInset selects the screen area the UI is positioned in (see UiScreenInset); it defaults to 'device'. Pass 'none' to place the UI over the whole screen.

    Parameters

    Returns void