A LayoutBlock is the fundamental unit of the UI tree. It combines a Hook (for positioning), an offset, and a LayoutElement (the actual drawable content). Blocks can have children, forming a tree structure.
Key fields for configuration:
name: Identifier for the block.parent: The name of the parent block.hook: Defines how this block anchors itself relative to its parent.offset: A Vec2 applied on top of the anchor position.params: A LayoutElement defining what this block draws.render_criteria: A list of RenderCriteria that must be met for the block to be drawn. If empty, it always draws.render_anti_criteria: A list of RenderCriteria that, if met, prevent the block from being drawn. This takes priority over render_criteria.
// Example conceptual structure of a LayoutBlock
LayoutBlock {
name: "my_block".to_string(),
parent: "root".to_string(),
hook: Hook { ... },
offset: Vec2 { x: 10.0, y: 10.0 },
params: LayoutElement::TextBlock(params),
render_criteria: vec![RenderCriteria::Summary],
render_anti_criteria: vec![],
// ...
}