-
Notifications
You must be signed in to change notification settings - Fork 7
Root
Refaltor77 edited this page Mar 29, 2026
·
1 revision
Top-level container for a UI screen. Manages namespace, elements, and animations.
use refaltor\ui\builders\Root;
$root = Root::create("my_namespace");
// or
$root = Root::create(); // namespace set later via RootBuild$root->addElement($element); // Add single element
$root->addElements([$el1, $el2]); // Add multiple$root->addAnimation($animation); // Add single animation
$root->addAnimations([$a1, $a2]); // Add multiple$root->setNamespace("my_namespace"); // Set namespace
$root->setTitleCondition("MY_TITLE"); // Visibility condition$root->generateAndSaveJson("ui/my_screen.json"); // Save to fileThe Root serializes to:
{
"namespace": "my_namespace",
"@my_animation": { "anim_type": "alpha", ... },
"my_element": { "type": "label", ... }
}