TUIX v0.5Beta
Getting Started with TUIX Core
This guide shows the standard v0.5 flow: initialize the engine, register builders, create/select a scene, start input for interactive apps, create widgets, run frames, and clean up.
Recommended Reading Order
- Install TUIX Core and verify imports.
- Build the first widget example.
- Read Widgets, Layout API, and Input Handling before composing larger screens.
Prerequisites
- Python 3.10 or newer.
- A terminal with ANSI escape support.
- Cython 0.29 or newer and a C compiler only when building from source.
Import Pattern
from tuix.core import engine, builders, scenes, registry, objects, buffers, inputStandard Workflow
- Call engine.init().
- Call builders.register_standard() before creating objects.
- Create a scene with scenes.init_scene("Main") and select it with scenes.select_scene("Main") or registry.registry.current_scene_name.
- Start input.listen() for interactive widgets.
- Create objects with objects.create_object(...).
- Run engine.main_loop() once per frame.
- Stop input and shut the engine down during cleanup.
Minimal Example
from tuix.core import engine, builders, scenes, objects, input
engine.init()
builders.register_standard()
scenes.init_scene('Main')
scenes.select_scene('Main')
input.listen()
uid = objects.create_object(builders.TEXT, 'Main', 0.5, 0.1, 0.05, 0.05)
obj = objects.get_object_by_uid(uid)
objects.tuix_text_set_text(obj, 'Hello from TUIX 0.5')
objects.tuix_text_set_fg(obj, 120, 220, 160)
for _ in range(5):
engine.main_loop()
input.stop()
engine.shutdown()What Happens Each Frame
- Input is read from native queues and routed to focused, captured, modal, or hitmap-picked widgets.
- Geometry is resolved from proportional modifiers, parent layout results, layout slots, and grid placements.
- Builders update state and provide pixels, often using persistent pixel buffers.
- The compositor clips viewports, builds a hitmap, merges buffers, and the renderer writes terminal-visible differences.