tree.gd 364 B

12345678910111213
  1. @tool
  2. extends Tree
  3. func _ready() -> void:
  4. var root: TreeItem = create_item()
  5. root.set_text(0, "Tree - Root")
  6. var child1: TreeItem = create_item(root)
  7. child1.set_text(0, "Tree - Child 1")
  8. var child2: TreeItem = create_item(root)
  9. child2.set_text(0, "Tree - Child 2")
  10. var subchild1: TreeItem = create_item(child1)
  11. subchild1.set_text(0, "Tree - Subchild 1")