UI
UiPanel
Renderable UI panel.
Panel node that inherits UiBox layout data.
Base node: UiBox
Source: perro_source/core/perro_ui/src/lib.rs
Fields
colorstylevisible
pub struct UiPanel { pub base: UiBox, pub color: Color,}Scene template
[node_instance]tags = ["runtime", "demo"]parent = @rootscript = "res://script.rs"script_vars = { speed = 4.0, health = 100 } [UiPanel] color = #ffffff style = 0 visible = true [/UiPanel][/node_instance]Script API
Create
let node_id = create_node!(ctx, UiPanel, "Spawned Node", ["enemy", "runtime"], parent_id);Access / mutate
let value = with_node!(ctx, UiPanel, node_id, |node| { node.color}); let pair = with_node!(ctx, UiPanel, node_id, |node| { (node.color, node.style)}); with_node_mut!(ctx, UiPanel, node_id, |node| { node.color = Color::new(1.0, 1.0, 1.0, 1.0);});