@tool YggdrasilDecorationsService API
Service for loading and creating decoration nodes in YggdrasilTreeView.
Signals
| Name |
|---|
| decoration_created(decoration: YggdrasilNodeButton) |
| decoration_pressed(node: YggdrasilNodeButton) |
Methods
| Type | Name |
|---|---|
| void | load_tree(tree_data: YggdrasilTree) |
| void | create_decoration(at_position: Vector2, icon_texture: Texture2D) |
| void | create_from_prefab(position: Vector2, prefab: YggdrasilPrefab) |
Signal Descriptions
decoration_created(decoration: YggdrasilNodeButton)
Emitted when a decoration node is created and added to the decorations container.
decoration_pressed(node: YggdrasilNodeButton)
Emitted when a decoration node is pressed.
Method Descriptions
void load_tree(tree_data: YggdrasilTree)
Loads decoration data from
tree_data.decorations, instantiates decoration nodes, configures their icons, positions them, adds them to the decorations container, and connects their pressed signal.
void create_decoration(at_position: Vector2, icon_texture: Texture2D)
Creates a new decoration node at
at_position, adds it to the decorations container, stores its translated position in tree data, appends its node data totree_data.decorations, and emitsdecoration_created.
void create_from_prefab(position: Vector2, prefab: YggdrasilPrefab)
Creates a decoration node from
prefab, optionally associates it with the prefab reference, positions it, adds it to the decorations container, and emitsdecoration_created.