Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
SceneTree¶
Manages the game loop via a hierarchy of nodes.
Description¶
As one of the most important classes, the SceneTree manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded.
You can also use the SceneTree to organize your nodes into groups: every node can be assigned as many groups as you want to create, e.g. an "enemy" group. You can then iterate these groups or even call methods and set properties on all the group's members at once.
SceneTree is the default MainLoop implementation used by scenes, and is thus in charge of the game loop.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Methods¶
void |
call_group ( StringName group, StringName method, ... ) vararg |
void |
call_group_flags ( int flags, StringName group, StringName method, ... ) vararg |
change_scene_to_file ( String path ) |
|
change_scene_to_packed ( PackedScene packed_scene ) |
|
create_timer ( float time_sec, bool process_always=true, bool process_in_physics=false, bool ignore_time_scale=false ) |
|
create_tween ( ) |
|
get_first_node_in_group ( StringName group ) |
|
get_frame ( ) const |
|
get_multiplayer ( NodePath for_path=NodePath("") ) const |
|
get_node_count ( ) const |
|
get_nodes_in_group ( StringName group ) |
|
has_group ( StringName name ) const |
|
void |
notify_group ( StringName group, int notification ) |
void |
notify_group_flags ( int call_flags, StringName group, int notification ) |
void |
queue_delete ( Object obj ) |
void |
|
void |