UITemplateElement
UITemplateElement loads a saved UITemplate resource and inserts its children and stylesheets into itself at runtime. It is used to reuse UI layouts created in the editor without duplicating code.
Circular template references are detected and logged as errors.
Everything documented on UIElement (layout, styles, events, data bindings, etc.) applies here too.
Usage
XML
| XML Attribute | Type | Description |
|---|---|---|
path |
string |
Resource path of the UITemplate to load (e.g. mymod:my_panel). |
Fields
| Name | Type | Access | Description |
|---|---|---|---|
path |
IResourcePath (nullable) |
private (getter) |
The currently loaded template path. |
template |
UITemplate (nullable) |
private (getter) |
The resolved UITemplate instance. |
Methods
| Method | Returns | Description |
|---|---|---|
setTemplate(IResourcePath) |
UITemplateElement |
Loads a new template, replacing the current children and styles. Pass null to clear. |