Registry API
The registry module (tuix.core.registry) provides access to the global TuixRegistry, which holds the active scene name, terminal dimensions, and pointers to all scenes, subcycles, and builders.
registry.registry
The global registry object. On platforms where the C registry symbol is directly available, this is the actual TuixRegistry struct. On Windows (where the symbol is not exported), a RegistryProxy object is used instead.
current_scene_name
from tuix.core import registry
# Set the active scene
registry.registry.current_scene_name = b"main"
# Read the active scene name
name = registry.registry.current_scene_name| Property | Type | Description |
|---|---|---|
| current_scene_name | bytes | Name of the currently active scene. Only this scene is rendered. |
Setting this property changes which scene is rendered on the next call to engine.main_loop(). The setter accepts both bytes and str (str values are auto-encoded to bytes). Internally, the setter prefers tuix_select_scene() for pointer-based lookup, falling back to direct attribute assignment.
Terminal Dimensions
The registry tracks current and previous terminal dimensions, updated every frame. These are read-only values reflecting the state as of the last main_loop() call.
| Field | Type | Description |
|---|---|---|
| terminal_width | int | Current terminal width in columns |
| terminal_height | int | Current terminal height in rows |
| terminal_width_old | int | Previous frame's terminal width |
| terminal_height_old | int | Previous frame's terminal height |