Using trees in-game
If you haven't, check Getting Started first.
Loading YggdrasilTree
To get YggdrasilTree resource, use YggdrasilLoader.load_tree(path: String).
In Getting Started we have created Group called Spells and Tree called Fire.
To get YggdrasilTree for our Fire tree, use YggdrasilLoader.load_tree("Spells/Fire").
Building YggdrasilTree
Now that we have our tree resource loaded, we can build it and place in our UI.
For that we will use YggdrasilBuilder. For full API documentation check YggdrasilBuilder. For now we are interested only in YggdrasilBuilder.new(tree: YggdrasilTree), YggdrasilBuilder.set_parent(new_parent: Node) and YggdrasilBuilder.build().
First we will initialize our builder
Then we have to provide a parent Node, this is where YggdrasilTreeView will be added. It's recommended to use Node of type Control (can be inherited) with clip_contents set to true (we don't need the tree view to be visible outside the parent).
Now all that is left to do is build the tree and get created YggdrasilTreeView.
Done! Our tree is now visible in-game and can be interacted with.