Calls method on each member of the given group. You can pass arguments to method by specifying them at the end of the method call. Note: method may only have 5 arguments at most (7 arguments passed to this method in total). Note: callGroup will always call methods with an one-frame delay, in a way similar to GodotObject.callDeferred. To call methods immediately, use callGroupFlags with the constant GROUP_CALL_REALTIME flag.
Calls method on each member of the given group, respecting the given groupcallflags. You can pass arguments to method by specifying them at the end of the method call. Note: method may only have 5 arguments at most (8 arguments passed to this method in total). Note: Group call flags are used to control the method calling behavior. If the constant GROUP_CALL_REALTIME flag is present in the flags argument, methods will be called immediately. If this flag isn't present in flags, methods will be called with a one-frame delay in a way similar to callGroup.
Changes the running scene to the one at the given path, after loading it into a PackedScene and creating a new instance. Returns constant OK on success, constant ERR_CANT_OPEN if the path cannot be loaded into a PackedScene, or constant ERR_CANT_CREATE if that scene cannot be instantiated. Note: The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the changeScene call.
Changes the running scene to a new instance of the given PackedScene. Returns constant OK on success or constant ERR_CANT_CREATE if the scene cannot be instantiated. Note: The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the changeSceneTo call.
Returns a SceneTreeTimer which will SceneTreeTimer.timeout after the given time in seconds elapsed in this SceneTree. If pause_mode_process is set to false, pausing the SceneTree will also pause the timer. Commonly used to create a one-shot delay timer as in the following example:
Returns the current frame number, i.e. the total frame count since the application started.
Returns the peer IDs of all connected peers of this SceneTree's networkPeer.
Returns the unique peer ID of this SceneTree's networkPeer.
Returns the number of nodes in this SceneTree.
Returns a list of all nodes assigned to the given group.
Returns the sender's peer ID for the most recently received RPC call.
Returns true if the given group exists.
Returns true if there is a networkPeer set.
Returns true if the most recent InputEvent was marked as handled with setInputAsHandled.
Returns true if this SceneTree's networkPeer is in server mode (listening for connections).
Sends the given notification to all members of the group.
Sends the given notification to all members of the group, respecting the given groupcallflags.
Queues the given object for deletion, delaying the call to GodotObject.free to after the current frame.
Quits the application at the end of the current iteration. A process exit_code can optionally be passed as an argument. If this argument is 0 or greater, it will override the OS.exitCode defined before quitting the application. Note: On iOS this method doesn't work. Instead, as recommended by the iOS Human Interface Guidelines, the user is expected to close apps via the Home button.
Reloads the currently active scene. Returns constant OK on success, constant ERR_UNCONFIGURED if no currentScene was defined yet, constant ERR_CANT_OPEN if currentScene cannot be loaded into a PackedScene, or constant ERR_CANT_CREATE if the scene cannot be instantiated.
If true, the application automatically accepts quitting. Enabled by default. For mobile platforms, see setQuitOnGoBack.
Sets the given property to value on all members of the given group.
Sets the given property to value on all members of the given group, respecting the given groupcallflags.
Marks the most recent InputEvent as handled.
If true, the application quits automatically on going back (e.g. on Android). Enabled by default. To handle 'Go Back' button when this option is disabled, use constant MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST.
Configures screen stretching to the given stretchmode, stretchaspect, minimum size and shrink ratio.
The current scene.
If true, collision shapes will be visible when running the game from the editor for debugging purposes.
If true, navigation polygons will be visible when running the game from the editor for debugging purposes.
The root of the edited scene.
The default MultiplayerAPI instance for this SceneTree.
If true (default value), enables automatic polling of the MultiplayerAPI for this SceneTree during idleFrame. If false, you need to manually call MultiplayerAPI.poll to process network packets and deliver RPCs/RSETs. This allows running RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual Mutex protection when accessing the MultiplayerAPI from threads.
The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the SceneTree will become a network server (check with isNetworkServer) and will set the root node's network mode to master, or it will become a regular peer with the root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to SceneTree's signals.
If true, the SceneTree is paused. Doing so will have the following behavior: - 2D and 3D physics will be stopped. - Node._process, Node._physicsProcess and Node._input will not be called anymore in nodes.
If true, the SceneTree's networkPeer refuses new incoming connections.
If true, font oversampling is used.
Construct a new instance of SceneTree. Note: use memnew!SceneTree instead.
Manages the game loop via a hierarchy of nodes.
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.