This commit is contained in:
Torsten 2024-12-22 12:24:50 +01:00
parent d16160323c
commit 1e22d28754
34 changed files with 708 additions and 1822 deletions

View file

@ -0,0 +1,28 @@
https://school.gdquest.com/courses/learn_2d_gamedev_godot_4/telling_a_story/your_first_words
Scene Unique Nodes
`To mark a node as unique, right-click it in the _Scene_ dock and select _Access As Unique Name_ in the dropdown menu.`
![[Pasted image 20240625081421.png]]
Restriction: They can only be addressed from the scene their uniqueness is defined in.
`There's also an important limitation to this feature: nodes with a scene-unique name only exist in the scene they're marked in. For example, if we mark our `RichTextLabel` in the scene dialogue.tscn as unique, we can't reference it from another scene.
You also can't mark nodes instantiated at runtime as unique. That's why we learned the more general way of getting nodes first with `get_node()`.`
Script shortcut:
1.) Mark unique nodes
2.) Drag and hold over script editor
3.) Press and hold Ctrl
4.) Release and see created initialization code
![[Pasted image 20240625081825.png]]
Quitting the game
![[Pasted image 20240625083616.png]]
`get_tree().quit()`