RmlUI

from acron.ui import RmlUI
class RmlUI(base, *, name: str = 'ui', authored_height: float = 1080.0, watch_resize: bool = True, scale: float = 1.0, interactive: bool = True)

Bases: DirectObject

Region + context + input plumbing for one window’s RmlUi layer.

Subclass per game; create content with make_model() / load_document(). Documents are authored in a fixed pixel space (authored_height, conventionally 1080) and mapped onto the real window via the density-independent-pixel ratio.

watch_resize=True (default) retargets the dp ratio automatically on window resize, assuming the region covers the full window. A game that letterboxes (moves the region’s DisplayRegion, e.g. exponaut’s 16:9 view rect) passes watch_resize=False and calls set_window_height() itself with the region’s pixel height.

scale multiplies the dp ratio on top of the window mapping — a HUD-size setting: everything the context’s documents author in dp grows or shrinks together, and set_scale() changes it live. A game that scales its HUD but not its menus gives each its own RmlUI.

interactive=False skips the input handler entirely, for a context whose documents take no input (a HUD); its events then never compete with an interactive context’s on the same window.

Inheritance diagram

digraph inheritancef88c66b536 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DirectObject" [URL="direct.showbase.DirectObject.html#direct.showbase.DirectObject.DirectObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="This is the class that all Direct/SAL classes should inherit from"]; "RmlUI" [URL="acron.ui.RmlUI.html#acron.ui.RmlUI",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Region + context + input plumbing for one window's RmlUi layer."]; "DirectObject" -> "RmlUI" [arrowsize=0.75,style=""]; }
name

The context’s name as made — unique in the process.