Skip to content

Namespace Apogee.UI

Classes

UiDataModel

A data model: a script's table tied to documents. <p data-model="stats">{{score}}</p> shows score of the table; data-if, data-for, data-class-, data-style- and data-value (which writes back what the player types) use it too, and data-event-click="buy(1)" calls the table's function buy. The table is read when RmlUi needs a value: change it and say so with (or change a top-level field with ), and the elements that show it are updated at the next frame.

UiElement

An element of a document (a div, a text node, a whole document) as scripts hold it. The object is a handle: it names the element without keeping it alive, so one whose element has been destroyed (its document was closed, an ancestor was destroyed) is false and every call on it does nothing or answers "none". An element made with or belongs to the object that holds it until it is put in a tree with or ; an element nobody ever put in a tree is destroyed when the script lets go of it, and one in a tree lives as long as the tree does. Elements are made, moved and changed here.

UiEvent

An event that reached a listener (). It is only good inside the handler: afterwards its calls do nothing.

UiInput

Feeds the UI from SDL: the pointer, buttons, wheel, keys and typed text of one window, as pumps them. Every event goes to the UI, which uses what lands on its elements; and tell the game whether it should leave an event alone. Call once a frame.

UiRenderer

Draws what RmlUi hands the host onto the frame's output, as a pass of the render graph: use it as (part of) the of SceneRenderer.Render. RmlUi compiles geometry once and renders it many times; the renderer keeps the compiled vertices and indices in memory and, when a frame is built, packs the geometry that frame draws into per-frame upload buffers (as the ImGui backend does), so nothing on the GPU depends on when RmlUi releases or re-renders a piece of geometry. Textures are images in the bindless heap, and the handle RmlUi holds for one is its bindless index (0 is the white texel that untextured geometry samples).

UiSystem

The game's user interface: RmlUi with one context (the screen), its documents, fonts and input, behind the script global ui. Documents are written in RML and RCSS (HTML and CSS as RmlUi knows them) with scripts of their own in Luau, or built from Luau; both go through s. RmlUi is process-wide, so there is one system at a time.