From 867dda112453b0c8e3903831baea570630c397f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 26 Jun 2019 15:57:13 +0200 Subject: [PATCH] doc: Proofread and complete various nodes All 100% completed: MainLoop, Node, Object, Path, Performance, Reference, Resource, SceneState, SceneTree, UndoRedo. Also fixed some en_GB occurrences as the reference spelling is en_US. --- core/object.cpp | 8 +-- core/os/main_loop.cpp | 6 +- doc/classes/ARVRAnchor.xml | 2 +- doc/classes/ConeTwistJoint.xml | 4 +- doc/classes/Directory.xml | 2 +- doc/classes/Light2D.xml | 2 +- doc/classes/MainLoop.xml | 81 +++++++++++++++++++++++-- doc/classes/Node.xml | 63 +++++++++++++------- doc/classes/NodePath.xml | 3 +- doc/classes/OS.xml | 8 +-- doc/classes/Object.xml | 106 ++++++++++++++++++++++----------- doc/classes/Path.xml | 7 ++- doc/classes/Path2D.xml | 4 +- doc/classes/PathFollow.xml | 2 +- doc/classes/Performance.xml | 20 ++++--- doc/classes/PhysicsServer.xml | 2 +- doc/classes/Reference.xml | 14 +++-- doc/classes/Resource.xml | 1 + doc/classes/SceneState.xml | 10 +++- doc/classes/SceneTree.xml | 80 +++++++++++++------------ doc/classes/UndoRedo.xml | 19 +++--- doc/classes/VehicleBody.xml | 2 +- doc/classes/VehicleWheel.xml | 4 +- doc/classes/VisualServer.xml | 3 +- 24 files changed, 301 insertions(+), 152 deletions(-) diff --git a/core/object.cpp b/core/object.cpp index 64f55f08a9..6b5cf4e66d 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1689,7 +1689,7 @@ void Object::clear_internal_resource_paths() { void Object::_bind_methods() { ClassDB::bind_method(D_METHOD("get_class"), &Object::get_class); - ClassDB::bind_method(D_METHOD("is_class", "type"), &Object::is_class); + ClassDB::bind_method(D_METHOD("is_class", "class"), &Object::is_class); ClassDB::bind_method(D_METHOD("set", "property", "value"), &Object::_set_bind); ClassDB::bind_method(D_METHOD("get", "property"), &Object::_get_bind); ClassDB::bind_method(D_METHOD("set_indexed", "property", "value"), &Object::_set_indexed_bind); @@ -1709,14 +1709,8 @@ void Object::_bind_methods() { ClassDB::bind_method(D_METHOD("has_meta", "name"), &Object::has_meta); ClassDB::bind_method(D_METHOD("get_meta_list"), &Object::_get_meta_list_bind); - //todo reimplement this per language so all 5 arguments can be called - - //ClassDB::bind_method(D_METHOD("call","method","arg1","arg2","arg3","arg4"),&Object::_call_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); - //ClassDB::bind_method(D_METHOD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); - ClassDB::bind_method(D_METHOD("add_user_signal", "signal", "arguments"), &Object::_add_user_signal, DEFVAL(Array())); ClassDB::bind_method(D_METHOD("has_user_signal", "signal"), &Object::_has_user_signal); - //ClassDB::bind_method(D_METHOD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array())); { MethodInfo mi; diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 895ce14ae9..9946ced2f3 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -44,9 +44,9 @@ void MainLoop::_bind_methods() { BIND_VMETHOD(MethodInfo("_input_event", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); BIND_VMETHOD(MethodInfo("_input_text", PropertyInfo(Variant::STRING, "text"))); BIND_VMETHOD(MethodInfo("_initialize")); - BIND_VMETHOD(MethodInfo("_iteration", PropertyInfo(Variant::REAL, "delta"))); - BIND_VMETHOD(MethodInfo("_idle", PropertyInfo(Variant::REAL, "delta"))); - BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "screen"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_iteration", PropertyInfo(Variant::REAL, "delta"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "_idle", PropertyInfo(Variant::REAL, "delta"))); + BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "from_screen"))); BIND_VMETHOD(MethodInfo("_finalize")); BIND_CONSTANT(NOTIFICATION_WM_MOUSE_ENTER); diff --git a/doc/classes/ARVRAnchor.xml b/doc/classes/ARVRAnchor.xml index 91f44151fa..ff2691f7a7 100644 --- a/doc/classes/ARVRAnchor.xml +++ b/doc/classes/ARVRAnchor.xml @@ -5,7 +5,7 @@ The ARVR Anchor point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them. - This node is mapped to one of the anchors through its unique id. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the id and the nodes will simply remain on 0,0,0 until a plane is recognised. + This node is mapped to one of the anchors through its unique id. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the id and the nodes will simply remain on 0,0,0 until a plane is recognized. Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view. diff --git a/doc/classes/ConeTwistJoint.xml b/doc/classes/ConeTwistJoint.xml index cd2289d715..f7266aad27 100644 --- a/doc/classes/ConeTwistJoint.xml +++ b/doc/classes/ConeTwistJoint.xml @@ -27,7 +27,7 @@ Swing is rotation from side to side, around the axis perpendicular to the twist axis. The swing span defines, how much rotation will not get corrected allong the swing axis. Could be defined as looseness in the [ConeTwistJoint]. - If below 0.05, this behaviour is locked. Default value: [code]PI/4[/code]. + If below 0.05, this behavior is locked. Default value: [code]PI/4[/code]. Twist is the rotation around the twist axis, this value defined how far the joint can twist. @@ -39,7 +39,7 @@ Swing is rotation from side to side, around the axis perpendicular to the twist axis. The swing span defines, how much rotation will not get corrected allong the swing axis. Could be defined as looseness in the [ConeTwistJoint]. - If below 0.05, this behaviour is locked. Default value: [code]PI/4[/code]. + If below 0.05, this behavior is locked. Default value: [code]PI/4[/code]. Twist is the rotation around the twist axis, this value defined how far the joint can twist. diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index 54aac33652..9c33b4fc0e 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -126,7 +126,7 @@ - Initialise the stream used to list all files and directories using the [method get_next] function, closing the current opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end]. + Initialize the stream used to list all files and directories using the [method get_next] function, closing the current opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end]. If you pass [code]skip_navigational[/code], then [code].[/code] and [code]..[/code] would be filtered out. If you pass [code]skip_hidden[/code], then hidden files would be filtered out. diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index a487fdf2fe..4c64691da1 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -78,7 +78,7 @@ - Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behaviour of a light. + Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml index 324ee72b8e..312b2ff692 100644 --- a/doc/classes/MainLoop.xml +++ b/doc/classes/MainLoop.xml @@ -1,10 +1,44 @@ - Main loop is the abstract main loop base class. + Abstract base class for the game's main loop. - Main loop is the abstract main loop base class. All other main loop classes are derived from it. Upon application start, a [MainLoop] has to be provided to OS, else the application will exit. This happens automatically (and a [SceneTree] is created), unless a main [Script] is supplied, which may or not create and return a [MainLoop]. + [MainLoop] is the abstract base class for a Godot project's game loop. It in inherited by [SceneTree], which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own [MainLoop] subclass instead of the scene tree. + Upon application start, a [MainLoop] implementation has to be provided to the OS, or the application will exit. This happens automatically (and a [SceneTree] is created) unless a main [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code], which should then be a [MainLoop] implementation. + Here is an example script implementing a simple [MainLoop]: + [codeblock] + extends MainLoop + + var time_elapsed = 0 + var keys_typed = [] + var quit = false + + func _initialize(): + print("Initialized:") + print(" Starting time: %s" % str(time_elapsed)) + + func _idle(delta): + time_elapsed += delta + # Return true to end the main loop + return quit + + func _input_event(event): + # Record keys + if event is InputEventKey and event.pressed and !event.echo: + keys_typed.append(OS.get_scancode_string(event.scancode)) + # Quit on Escape press + if event.scancode == KEY_ESCAPE: + quit = true + # Quit on any mouse click + if event is InputEventMouseButton: + quit = true + + func _finalize(): + print("Finalized:") + print(" End time: %s" % str(time_elapsed)) + print(" Keys typed: %s" % var2str(keys_typed)) + [/codeblock] @@ -14,9 +48,10 @@ - + + Called when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated. @@ -27,12 +62,13 @@ - + - Called each idle frame with time since last call as an only argument. + Called each idle frame with the time since the last idle frame as argument (in seconds). Equivalent to [method Node._process]. + If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame. @@ -48,6 +84,7 @@ + Called whenever an [InputEvent] is received by the main loop. @@ -56,20 +93,24 @@ + Deprecated callback, does not do anything. Use [method _input_event] to parse text input. Will be removed in Godot 4.0. - + + Called each physics frame with the time since the last physics frame as argument (in seconds). Equivalent to [method Node._physics_process]. + If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame. + Should not be called manually, override [method _finalize] instead. Will be removed in Godot 4.0. @@ -78,12 +119,14 @@ + Should not be called manually, override [method _idle] instead. Will be removed in Godot 4.0. + Should not be called manually, override [method _initialize] instead. Will be removed in Godot 4.0. @@ -92,6 +135,7 @@ + Should not be called manually, override [method _input_event] instead. Will be removed in Godot 4.0. @@ -100,6 +144,7 @@ + Should not be called manually, override [method _input_text] instead. Will be removed in Godot 4.0. @@ -108,33 +153,57 @@ + Should not be called manually, override [method _iteration] instead. Will be removed in Godot 4.0. + Notification received from the OS when the mouse enters the game window. + Implemented on desktop and web platforms. + Notification received from the OS when the mouse leaves the game window. + Implemented on desktop and web platforms. + Notification received from the OS when the game window is focused. + Implemented on all platforms. + Notification received from the OS when the game window is unfocused. + Implemented on all platforms. + Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4). + Implemented on desktop platforms. + Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android). + Specific to the Android platform. + Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus). + No supported platforms currently send this notification. + Notification received from the OS when the application is exceeding its allocated memory. + Specific to the iOS platform. + Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr]. + Notification received from the OS when a request for "About" information is sent. + Specific to the macOS platform. + Notification received from Godot's crash handler when the engine is about to crash. + Implemented on desktop platforms if the crash handler is enabled. + Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string). + Specific to the macOS platform. diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index e8b43ead85..851f9f45fe 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -6,8 +6,8 @@ Nodes are Godot's building blocks. They can be assigned as the child of another node, resulting in a tree arrangement. A given node can contain any number of nodes as children with the requirement that all siblings (direct children of a node) should have unique names. A tree of nodes is called a [i]scene[/i]. Scenes can be saved to the disk and then instanced into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects. - [b]Scene tree:[/b] The [SceneTree] contains the active tree of nodes. When a node is added to the scene tree, it receives the NOTIFICATION_ENTER_TREE notification and its [method _enter_tree] callback is triggered. Child nodes are always added [i]after[/i] their parent node, i.e. the [method _enter_tree] callback of a parent node will be triggered before its child's. - Once all nodes have been added in the scene tree, they receive the NOTIFICATION_READY notification and their respective [method _ready] callbacks are triggered. For groups of nodes, the [method _ready] callback is called in reverse order, starting with the children and moving up to the parent nodes. + [b]Scene tree:[/b] The [SceneTree] contains the active tree of nodes. When a node is added to the scene tree, it receives the [constant NOTIFICATION_ENTER_TREE] notification and its [method _enter_tree] callback is triggered. Child nodes are always added [i]after[/i] their parent node, i.e. the [method _enter_tree] callback of a parent node will be triggered before its child's. + Once all nodes have been added in the scene tree, they receive the [constant NOTIFICATION_READY] notification and their respective [method _ready] callbacks are triggered. For groups of nodes, the [method _ready] callback is called in reverse order, starting with the children and moving up to the parent nodes. This means that when adding a node to the scene tree, the following order will be used for the callbacks: [method _enter_tree] of the parent, [method _enter_tree] of the children, [method _ready] of the children and finally [method _ready] of the parent (recursively for the entire scene tree). [b]Processing:[/b] Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback [method _process], toggled with [method set_process]) happens as fast as possible and is dependent on the frame rate, so the processing time [i]delta[/i] is passed as an argument. Physics processing (callback [method _physics_process], toggled with [method set_physics_process]) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine. Nodes can also process input events. When present, the [method _input] function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the [method _unhandled_input] function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI [Control] nodes), ensuring that the node only receives the events that were meant for it. @@ -25,7 +25,7 @@ Called when the node enters the [SceneTree] (e.g. upon instancing, scene changing, or after calling [method add_child] in a script). If the node has children, its [method _enter_tree] callback will be called first, and then that of the children. - Corresponds to the NOTIFICATION_ENTER_TREE notification in [method Object._notification]. + Corresponds to the [constant NOTIFICATION_ENTER_TREE] notification in [method Object._notification]. @@ -33,7 +33,7 @@ Called when the node is about to leave the [SceneTree] (e.g. upon freeing, scene changing, or after calling [method remove_child] in a script). If the node has children, its [method _exit_tree] callback will be called last, after all its children have left the tree. - Corresponds to the NOTIFICATION_EXIT_TREE notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited] + Corresponds to the [constant NOTIFICATION_EXIT_TREE] notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited] @@ -64,7 +64,7 @@ Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [code]delta[/code] variable should be constant. It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process]. - Corresponds to the NOTIFICATION_PHYSICS_PROCESS notification in [method Object._notification]. + Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification]. @@ -75,7 +75,7 @@ Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [code]delta[/code] time since the previous frame is not constant. It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process]. - Corresponds to the NOTIFICATION_PROCESS notification in [method Object._notification]. + Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification]. @@ -83,7 +83,7 @@ Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their [method _ready] callbacks get triggered first, and the parent node will receive the ready notification afterwards. - Corresponds to the NOTIFICATION_READY notification in [method Object._notification]. See also the [code]onready[/code] keyword for variables. + Corresponds to the [constant NOTIFICATION_READY] notification in [method Object._notification]. See also the [code]onready[/code] keyword for variables. Usually used for initialization. For even earlier initialization, [method Object._init] may be used. Also see [method _enter_tree]. @@ -120,7 +120,7 @@ Adds a child node. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node. - Setting "legible_unique_name" [code]true[/code] creates child nodes with human-readable names, based on the name of the node being instanced instead of its type. + Setting [code]legible_unique_name[/code] to [code]true[/code] creates child nodes with human-readable names, based on the name of the node being instanced instead of its type. @@ -134,7 +134,7 @@ Adds a child node. The child is placed below the given node in the list of children. - Setting "legible_unique_name" [code]true[/code] creates child nodes with human-readable names, based on the name of the node being instanced instead of its type. + Setting [code]legible_unique_name[/code] to [code]true[/code] creates child nodes with human-readable names, based on the name of the node being instanced instead of its type. @@ -146,7 +146,7 @@ Adds the node to a group. Groups are helpers to name and organize a subset of nodes, for example "enemies" or "collectables". A node can be in any number of groups. Nodes can be assigned a group at any time, but will not be added until they are inside the scene tree (see [method is_inside_tree]). See notes in the description, and the group methods in [SceneTree]. - [code]persistent[/code] option is used when packing node to [PackedScene] and saving to file. Non-persistent groups aren't stored. + The [code]persistent[/code] option is used when packing node to [PackedScene] and saving to file. Non-persistent groups aren't stored. @@ -314,7 +314,7 @@ - Returns the time elapsed since the last physics-bound frame (see [method _physics_process]). This is always a constant value in physics processing unless the frames per second is changed in [OS]. + Returns the time elapsed since the last physics-bound frame (see [method _physics_process]). This is always a constant value in physics processing unless the frames per second is changed via [member Engine.target_fps]. @@ -475,7 +475,7 @@ - Moves a child node to a different position (order) amongst the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful. + Moves a child node to a different position (order) among the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful. @@ -525,7 +525,7 @@ - Calls the given method (if present) with the arguments given in [code]args[/code] on this node and recursively on all its children. If the parent_first argument is [code]true[/code] then the method will be called on the current node first, then on all children. If it is [code]false[/code] then the children will be called first. + Calls the given method (if present) with the arguments given in [code]args[/code] on this node and recursively on all its children. If the [code]parent_first[/code] argument is [code]true[/code] then the method will be called on the current node first, then on all children. If it is [code]false[/code] then the children will be called first. @@ -534,7 +534,7 @@ - Notifies the current node and all its children recursively by calling notification() on all of them. + Notifies the current node and all its children recursively by calling [method Object.notification] on all of them. @@ -730,7 +730,7 @@ - Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a NOTIFICATION_PHYSICS_PROCESS at a fixed (usually 60 fps, see [OS] to change) interval (and the [method _physics_process] callback will be called if exists). Enabled automatically if [method _physics_process] is overridden. Any calls to this before [method _ready] will be ignored. + Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a [constant NOTIFICATION_PHYSICS_PROCESS] at a fixed (usually 60 FPS, see [member Engine.target_fps] to change) interval (and the [method _physics_process] callback will be called if exists). Enabled automatically if [method _physics_process] is overridden. Any calls to this before [method _ready] will be ignored. @@ -739,7 +739,7 @@ - Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal [method _physics_process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ([method set_physics_process]). Only useful for advanced uses to manipulate built-in nodes behaviour. + Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal [method _physics_process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ([method set_physics_process]). Only useful for advanced uses to manipulate built-in nodes behavior. @@ -748,7 +748,7 @@ - Enables or disables processing. When a node is being processed, it will receive a NOTIFICATION_PROCESS on every drawn frame (and the [method _process] callback will be called if exists). Enabled automatically if [method _process] is overridden. Any calls to this before [method _ready] will be ignored. + Enables or disables processing. When a node is being processed, it will receive a [constant NOTIFICATION_PROCESS] on every drawn frame (and the [method _process] callback will be called if exists). Enabled automatically if [method _process] is overridden. Any calls to this before [method _ready] will be ignored. @@ -766,7 +766,7 @@ - Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal [method _process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ([method set_process]). Only useful for advanced uses to manipulate built-in nodes behaviour. + Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal [method _process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ([method set_process]). Only useful for advanced uses to manipulate built-in nodes behavior. @@ -775,6 +775,7 @@ + Sets the node's priority in the execution order of the enabled processing callbacks (i.e. [constant NOTIFICATION_PROCESS], [constant NOTIFICATION_PHYSICS_PROCESS] and their internal counterparts). Nodes with a higher process priority will have their processing callbacks executed first. @@ -878,7 +879,7 @@ Notification received every frame when the process flag is set (see [method set_process]). - Notification received when a node is set as a child of another node. Note that this doesn't mean that a node entered the Scene Tree. + Notification received when a node is set as a child of another node. Note that this doesn't mean that a node entered the [SceneTree]. Notification received when a node is unparented (parent removed it from the list of children). @@ -902,32 +903,54 @@ Notification received every frame when the internal physics process flag is set (see [method set_physics_process_internal]). + Notification received from the OS when the mouse enters the game window. + Implemented on desktop and web platforms. + Notification received from the OS when the mouse leaves the game window. + Implemented on desktop and web platforms. + Notification received from the OS when the game window is focused. + Implemented on all platforms. + Notification received from the OS when the game window is unfocused. + Implemented on all platforms. + Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4). + Implemented on desktop platforms. + Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android). + Specific to the Android platform. + Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus). + No supported platforms currently send this notification. + Notification received from the OS when the application is exceeding its allocated memory. + Specific to the iOS platform. Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr]. + Notification received from the OS when a request for "About" information is sent. + Specific to the macOS platform. + Notification received from Godot's crash handler when the engine is about to crash. + Implemented on desktop platforms if the crash handler is enabled. + Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string). + Specific to the macOS platform. - Inherits pause mode from the node's parent. For the root node, it is equivalent to PAUSE_MODE_STOP. Default. + Inherits pause mode from the node's parent. For the root node, it is equivalent to [constant PAUSE_MODE_STOP]. Default. Stop processing when the [SceneTree] is paused. diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml index 2879a83efb..67f12813cc 100644 --- a/doc/classes/NodePath.xml +++ b/doc/classes/NodePath.xml @@ -47,6 +47,7 @@ # This will be parsed as a node path to the 'x' component of the 'position' property in the current node var property_path = node_path.get_as_property_path() print(property_path) # :position:x + [/codeblock] @@ -80,7 +81,7 @@ Get the number of node names which make up the path. Subnames (see [method get_subname_count]) are not included. - For example, [code]"Path2D/PathFollow2D/Sprite"[code] has 3 names. + For example, [code]"Path2D/PathFollow2D/Sprite"[/code] has 3 names. diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 3292438851..28f1757039 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -102,7 +102,7 @@ Execute the file at the given path with the arguments passed as an array of strings. Platform path resolution will take place. The resolved file must exist and be executable. The arguments are used in the given order and separated by a space, so [code]OS.execute('ping', ['-w', '3', 'godotengine.org'], false)[/code] will resolve to [code]ping -w 3 godotengine.org[/code] in the system's shell. - This method has slightly different behaviour based on whether the [code]blocking[/code] mode is enabled. + This method has slightly different behavior based on whether the [code]blocking[/code] mode is enabled. When [code]blocking[/code] is enabled, the Godot thread will pause its execution while waiting for the process to terminate. The shell output of the process will be written to the [code]output[/code] array as a single string. When the process terminates, the Godot thread will resume execution. When [code]blocking[/code] is disabled, the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so [code]output[/code] will be empty. The return value also depends on the blocking mode. When blocking, the method will return -2 (no process ID information is available in blocking mode). When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). If the process forking (non-blocking) or opening (blocking) fails, the method will return -1. @@ -222,7 +222,7 @@ Returns IME cursor position (currently edited portion of the string) relative to the characters in the composition string. - [code]NOTIFICATION_OS_IME_UPDATE[/code] is sent to the application to notify it of changes to the IME cursor position. + [constant MainLoop.NOTIFICATION_OS_IME_UPDATE] is sent to the application to notify it of changes to the IME cursor position. @@ -230,7 +230,7 @@ Returns IME intermediate composition string. - [code]NOTIFICATION_OS_IME_UPDATE[/code] is sent to the application to notify it of changes to the IME composition string. + [constant MainLoop.NOTIFICATION_OS_IME_UPDATE] is sent to the application to notify it of changes to the IME composition string. @@ -280,7 +280,7 @@ - Returns the current state of the device regarding battery and power. See [code]POWERSTATE_*[/code] constants. + Returns the current state of the device regarding battery and power. See [enum PowerState] constants. diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index a1fba1ac8d..59e2c2790e 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -9,7 +9,7 @@ Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the [method free] method from your script or delete the instance from C++. Some classes that extend Object add memory management. This is the case of [Reference], which counts references and deletes itself automatically when no longer referenced. [Node], another fundamental type, deletes all its children when freed from memory. Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in [method _get_property_list] and handled in [method _get] and [method _set]. However, scripting languages and C++ have simpler means to export them. - Objects also receive notifications. Notifications are a simple way to notify the object about simple events, so they can all be handled together. See [method _notification]. + Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification]. @@ -20,6 +20,7 @@ + Virtual method which can be overridden to customize the return value of [method get]. Returns the given property. Returns [code]null[/code] if the [code]property[/code] does not exist. @@ -27,14 +28,16 @@ - Returns the object's property list as an [Array] of dictionaries. Dictionaries must contain: name:String, type:int (see TYPE_* enum in [@GlobalScope]) and optionally: hint:int (see PROPERTY_HINT_* in [@GlobalScope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@GlobalScope]). + Virtual method which can be overridden to customize the return value of [method get_property_list]. + Returns the object's property list as an [Array] of dictionaries. + Each property's [Dictionary] must contain at least [code]name: String[/code] and [code]type: int[/code] (see [enum @GlobalScope.Variant.Type]) entries. Optionally, it can also include [code]hint: int[/code] (see [enum @GlobalScope.PropertyHint]), [code]hint_string: String[/code], and [code]usage: int[/code] (see [enum @GlobalScope.PropertyUsageFlags]). - The virtual method called upon initialization. + Called when the object is initialized. @@ -43,7 +46,7 @@ - Notify the object internally using an ID. + Called whenever the object receives a notification, which is identified in [code]what[/code] by a constant. The base [Object] has two constants [constant NOTIFICATION_POSTINITIALIZE] and [constant NOTIFICATION_PREDELETE], but subclasses such as [Node] define a lot more notifications which are also received by this method. @@ -54,6 +57,7 @@ + Virtual method which can be overridden to customize the return value of [method set]. Sets a property. Returns [code]true[/code] if the [code]property[/code] exists. @@ -61,8 +65,8 @@ + Virtual method which can be overridden to customize the return value of [method to_string], and thus the object's representation where it is converted to a string, e.g. with [code]print(obj)[/code]. Returns a [String] representing the object. Default is [code]"[ClassName:RID]"[/code]. - Override this method to customize the [String] representation of the object when it's being converted to a string, for example: [code]print(obj)[/code]. @@ -73,7 +77,7 @@ - Adds a user-defined [code]signal[/code]. Arguments are optional, but can be added as an [Array] of dictionaries, each containing "name" and "type" (from [@GlobalScope] TYPE_*). + Adds a user-defined [code]signal[/code]. Arguments are optional, but can be added as an [Array] of dictionaries, each containing [code]name: String[/code] and [code]type: int[/code] (see [enum @GlobalScope.Variant.Type]) entries. @@ -82,7 +86,10 @@ - Calls the [code]method[/code] on the object and returns a result. Pass parameters as a comma separated list. + Calls the [code]method[/code] on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: + [codeblock] + call("set", "position", Vector2(42.0, 0.0)) + [/codeblock] @@ -91,7 +98,10 @@ - Calls the [code]method[/code] on the object during idle time and returns a result. Pass parameters as a comma separated list. + Calls the [code]method[/code] on the object during idle time and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: + [codeblock] + call_deferred("set", "position", Vector2(42.0, 0.0)) + [/codeblock] @@ -102,14 +112,17 @@ - Calls the [code]method[/code] on the object and returns a result. Pass parameters as an [Array]. + Calls the [code]method[/code] on the object and returns the result. Contrarily to [method call], this method does not support a variable number of arguments but expected all parameters passed via a single [Array]. + [codeblock] + callv("set", [ "position", Vector2(42.0, 0.0) ]) + [/codeblock] - Returns [code]true[/code] if the object can translate strings. + Returns [code]true[/code] if the object can translate strings. See [method set_message_translation] and [method tr]. @@ -126,9 +139,15 @@ - Connects a [code]signal[/code] to a [code]method[/code] on a [code]target[/code] object. Pass optional [code]binds[/code] to the call. Use [code]flags[/code] to set deferred or one shot connections. See [code]CONNECT_*[/code] constants. - A [code]signal[/code] can only be connected once to a [code]method[/code]. It will throw an error if already connected. To avoid this, first, use [method is_connected] to check for existing connections. + Connects a [code]signal[/code] to a [code]method[/code] on a [code]target[/code] object. Pass optional [code]binds[/code] to the call as an [Array] of parameters. Use [code]flags[/code] to set deferred or one shot connections. See [enum ConnectFlags] constants. + A [code]signal[/code] can only be connected once to a [code]method[/code]. It will throw an error if already connected, unless the signal was connected with [constant CONNECT_REFERENCE_COUNTED]. To avoid this, first, use [method is_connected] to check for existing connections. If the [code]target[/code] is destroyed in the game's lifecycle, the connection will be lost. + Examples: + [codeblock] + connect("pressed", self, "_on_Button_pressed") # BaseButton signal + connect("text_entered", self, "_on_LineEdit_text_entered") # LineEdit signal + connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # User-defined signal + [/codeblock] @@ -151,14 +170,18 @@ - Emits the given [code]signal[/code]. + Emits the given [code]signal[/code]. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: + [codeblock] + emit_signal("hit", weapon_type, damage) + emit_signal("game_over") + [/codeblock] - Deletes the object from memory. + Deletes the object from memory. Any pre-existing reference to the freed object will now return [code]null[/code]. @@ -167,7 +190,7 @@ - Returns a [Variant] for a [code]property[/code]. + Returns the [Variant] value of the given [code]property[/code]. @@ -182,10 +205,10 @@ Returns an [Array] of dictionaries with information about signals that are connected to the object. - Inside each [Dictionary] there are 3 fields: - - "source" is a reference to signal emitter. - - "signal_name" is name of connected signal. - - "method_name" is a name of method to which signal is connected. + Each [Dictionary] contains three String entries: + - [code]source[/code] is a reference to the signal emitter. + - [code]signal_name[/code] is the name of the connected signal. + - [code]method_name[/code] is the name of the method to which the signal is connected. @@ -194,8 +217,7 @@ - Get indexed object property by String. - Property indices get accessed with colon separation, for example: [code]position:x[/code] + Get the object's property indexed by the given [NodePath]. The node path should be relative to the current object and can use the colon character ([code]:[/code]) to access nested properties. Examples: [code]"position:x"[/code] or [code]"material:next_pass:blend_mode"[/code]. @@ -212,7 +234,7 @@ - Returns the object's metadata for the given [code]name[/code]. + Returns the object's metadata entry for the given [code]name[/code]. @@ -233,14 +255,15 @@ - Returns the list of properties as an [Array] of dictionaries. Dictionaries contain: name:String, type:int (see TYPE_* enum in [@GlobalScope]) and optionally: hint:int (see PROPERTY_HINT_* in [@GlobalScope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@GlobalScope]). + Returns the object's property list as an [Array] of dictionaries. + Each property's [Dictionary] contain at least [code]name: String[/code] and [code]type: int[/code] (see [enum @GlobalScope.Variant.Type]) entries. Optionally, it can also include [code]hint: int[/code] (see [enum @GlobalScope.PropertyHint]), [code]hint_string: String[/code], and [code]usage: int[/code] (see [enum @GlobalScope.PropertyUsageFlags]). - Returns the object's [Script] or [code]null[/code] if one doesn't exist. + Returns the object's [Script] instance, or [code]null[/code] if none is assigned. @@ -265,7 +288,7 @@ - Returns [code]true[/code] if a metadata is found with the given [code]name[/code]. + Returns [code]true[/code] if a metadata entry is found with the given [code]name[/code]. @@ -296,10 +319,10 @@ - + - Returns [code]true[/code] if the object inherits from the given [code]type[/code]. + Returns [code]true[/code] if the object inherits from the given [code]class[/code]. @@ -319,7 +342,7 @@ - Returns [code]true[/code] if the [code]queue_free[/code] method was called for the object. + Returns [code]true[/code] if the [method Node.queue_free] method was called for the object. @@ -330,13 +353,15 @@ - Notify the object of something. + Send a given notification to the object, which will also trigger a call to the [method _notification] method of all classes that the object inherits from. + If [code]reversed[/code] is [code]true[/code], [method _notification] is called first on the object's own class, and then up to its successive parent classes. If [code]reversed[/code] is [code]false[/code], [method _notification] is called first on the highest ancestor ([Object] itself), and then down to its successive inheriting classes. + Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds. @@ -345,6 +370,7 @@ + Removes a given entry from the object's metadata. @@ -355,7 +381,7 @@ - Set property into the object. + Assigns a new value to the given property. If the [code]property[/code] does not exist, nothing will happen. @@ -375,7 +401,7 @@ - Set property into the object, after the current frame's physics step. This is equivalent to calling [method set] via [method call_deferred], i.e. [code]call_deferred("set", [property, value])[/code]. + Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling [method set] via [method call_deferred], i.e. [code]call_deferred("set", property, value)[/code]. @@ -386,6 +412,12 @@ + Assigns a new value to the property identified by the [NodePath]. The node path should be relative to the current object and can use the colon character ([code]:[/code]) to access nested properties. Example: + [codeblock] + set_indexed("position", Vector2(42, 0)) + set_indexed("position:y", -10) + print(position) # (42, -10) + [/codeblock] @@ -394,7 +426,7 @@ - Define whether the object can translate strings (with calls to [method tr]). Default is [code]true[/code]. + Defines whether the object can translate strings (with calls to [method tr]). Default is [code]true[/code]. @@ -405,7 +437,7 @@ - Set a metadata into the object. Metadata is serialized. Metadata can be [i]anything[/i]. + Adds or changes a given entry in the object's metadata. Metadata are serialized, and can take any [Variant] value. @@ -414,7 +446,7 @@ - Set a script into the object, scripts extend the object functionality. + Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality. @@ -431,14 +463,15 @@ - Translate a message. Only works if message translation is enabled (which it is by default). See [method set_message_translation]. + Translates a message using translation catalogs configured in the Project Settings. + Only works if message translation is enabled (which it is by default), otherwise it returns the [code]message[/code] unchanged. See [method set_message_translation]. - Emitted whenever the script of the Object is changed. + Emitted whenever the object's script is changed. @@ -459,6 +492,7 @@ One shot connections disconnect themselves after emission. + Connect a signal as reference counted. This means that a given signal can be connected several times to the same target, and will only be fully disconnected once no references are left. diff --git a/doc/classes/Path.xml b/doc/classes/Path.xml index 1b553dbc02..12ae8fd3d5 100644 --- a/doc/classes/Path.xml +++ b/doc/classes/Path.xml @@ -1,10 +1,11 @@ - Container for a [Curve3D]. + Contains a [Curve3D] path for [PathFollow] nodes to follow. - This class is a container/Node-ification of a [Curve3D], so it can have [Spatial] properties and [Node] info. + Can have [PathFollow] child nodes moving along the [Curve3D]. See [PathFollow] for more information on the usage. + Note that the path is considered as relative to the moved nodes (children of [PathFollow]). As such, the curve should usually start with a zero vector [code](0, 0, 0)[/code]. @@ -12,11 +13,13 @@ + A [Curve3D] describing the path. + Emitted when the [member curve] changes. diff --git a/doc/classes/Path2D.xml b/doc/classes/Path2D.xml index ce15b3eab2..a50df96bda 100644 --- a/doc/classes/Path2D.xml +++ b/doc/classes/Path2D.xml @@ -4,8 +4,8 @@ Contains a [Curve2D] path for [PathFollow2D] nodes to follow. - Can have [PathFollow2D] child-nodes moving along the [Curve2D]. See [PathFollow2D] for more information on this usage. - Note that the path is considered as relative to the moved nodes (children of [PathFollow2D]) - usually the curve should start with a zero vector (0, 0). + Can have [PathFollow2D] child nodes moving along the [Curve2D]. See [PathFollow2D] for more information on the usage. + Note that the path is considered as relative to the moved nodes (children of [PathFollow2D]). As such, the curve should usually start with a zero vector [code](0, 0)[/code]. diff --git a/doc/classes/PathFollow.xml b/doc/classes/PathFollow.xml index ba27ca04eb..f0b238eb1d 100644 --- a/doc/classes/PathFollow.xml +++ b/doc/classes/PathFollow.xml @@ -27,7 +27,7 @@ The distance from the first vertex, measured in 3D units along the path. This sets this node's position to a point within the path. - Allows or forbids rotation on one or more axes, depending on the constants being used. + Allows or forbids rotation on one or more axes, depending on the [enum RotationMode] constants being used. The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the offset within the path, as the offset supplied is multiplied internally by the path's length. diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml index 3860511615..3bcc001a2b 100644 --- a/doc/classes/Performance.xml +++ b/doc/classes/Performance.xml @@ -1,7 +1,7 @@ - Exposes performance related data. + Exposes performance-related data. This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the [i]Monitor[/i] tab in the editor's [i]Debugger[/i] panel. By using the [method get_monitor] method of this class, you can access this data from your code. Note that a few of these monitors are only available in debug mode and will always return 0 when used in a release build. @@ -16,7 +16,7 @@ - Returns the value of one of the available monitors. You should provide one of this class's constants as the argument, like this: + Returns the value of one of the available monitors. You should provide one of the [enum Monitor] constants as the argument, like this: [codeblock] print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console [/codeblock] @@ -25,13 +25,13 @@ - Frames per second. + Number of frames per second. - Time it took to complete one frame. + Time it took to complete one frame, in seconds. - Time it took to complete one physics frame. + Time it took to complete one physics frame, in seconds. Static memory currently used, in bytes. Not available in release builds. @@ -58,6 +58,7 @@ Number of nodes currently instanced in the scene tree. This also includes the root node. + Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree. 3D objects drawn per frame. @@ -78,15 +79,16 @@ Draw calls per frame. 3D only. - Video memory used. Includes both texture and vertex memory. + The amount of video memory used, i.e. texture and vertex memory combined. - Texture memory used. + The amount of texture memory used. - Vertex memory used. + The amount of vertex memory used. + Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0. Number of active [RigidBody2D] nodes in the game. @@ -107,8 +109,10 @@ Number of islands in the 3D physics engine. + Output latency of the [AudioServer]. + Represents the size of the [enum Monitor] enum. diff --git a/doc/classes/PhysicsServer.xml b/doc/classes/PhysicsServer.xml index 78a6ed8ac0..eff0d4ef2e 100644 --- a/doc/classes/PhysicsServer.xml +++ b/doc/classes/PhysicsServer.xml @@ -1390,7 +1390,7 @@ Swing is rotation from side to side, around the axis perpendicular to the twist axis. The swing span defines, how much rotation will not get corrected allong the swing axis. Could be defined as looseness in the [ConeTwistJoint]. - If below 0.05, this behaviour is locked. Default value: [code]PI/4[/code]. + If below 0.05, this behavior is locked. Default value: [code]PI/4[/code]. Twist is the rotation around the twist axis, this value defined how far the joint can twist. diff --git a/doc/classes/Reference.xml b/doc/classes/Reference.xml index bc24483367..9e6c403873 100644 --- a/doc/classes/Reference.xml +++ b/doc/classes/Reference.xml @@ -1,10 +1,12 @@ - Base class for anything that keeps a reference count. + Base class for reference-counted objects. - Base class for anything that keeps a reference count. Resource and many other helper objects inherit this. References keep an internal reference counter so they are only released when no longer in use. + Base class for any object that keeps a reference count. [Resource] and many other helper objects inherit this class. + References keep an internal reference counter so that they are automatically released when no longer in use, and only then. References therefore do not need to be freed manually with [method Object.free]. + In the vast majority of use cases, instantiating and using [Reference]-derived types is all you need to do. The methods provided in this class are only for advanced users, and can cause issues if misused. @@ -13,20 +15,24 @@ + Initializes the internal reference counter. Use this only if you really know what you are doing. + Returns whether the initialization was successful. - Increase the internal reference counter. Use this only if you really know what you are doing. + Increments the internal reference counter. Use this only if you really know what you are doing. + Returns whether the increment was successful. - Decrease the internal reference counter. Use this only if you really know what you are doing. + Decrements the internal reference counter. Use this only if you really know what you are doing. + Returns whether the decrement was successful. diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index acd608de6a..d2315275b1 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -72,6 +72,7 @@ + Emitted whenever the resource changes. diff --git a/doc/classes/SceneState.xml b/doc/classes/SceneState.xml index 34a28b5d1c..8cbc582bf5 100644 --- a/doc/classes/SceneState.xml +++ b/doc/classes/SceneState.xml @@ -5,6 +5,7 @@ Maintains a list of resources, nodes, exported, and overridden properties, and built-in scripts associated with a scene. + This class cannot be instantiated directly, it is retrieved for a given scene as the result of [method PackedScene.get_state]. @@ -23,6 +24,7 @@ Returns the number of signal connections in the scene. + The [code]idx[/code] argument used to query connection metadata in other [code]get_connection_*[/code] methods in the interval [code][0, get_connection_count() - 1][/code]. @@ -31,7 +33,7 @@ - Returns the flags for the signal at [code]idx[/code]. See [Object]'s [code]CONNECT_*[/code] flags. + Returns the connection flags for the signal at [code]idx[/code]. See [enum Object.ConnectFlags] constants. @@ -75,6 +77,7 @@ Returns the number of nodes in the scene. + The [code]idx[/code] argument used to query node data in other [code]get_node_*[/code] methods in the interval [code][0, get_node_count() - 1][/code]. @@ -92,6 +95,7 @@ + Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instanced or inherited scene among siblings from the base scene. Despite the name, this index is not related to the [code]idx[/code] argument used here and in other methods. @@ -100,7 +104,7 @@ - Returns the scene for the node at [code]idx[/code] or [code]null[/code] if the node is not an instance. + Returns a [PackedScene] for the node at [code]idx[/code] (i.e. the whole branch starting at this node, with its child nodes and resources), or [code]null[/code] if the node is not an instance. @@ -139,6 +143,7 @@ Returns the path to the node at [code]idx[/code]. + If [code]for_parent[/code] is [code]true[/code], returns the path of the [code]idx[/code] node's parent instead. @@ -148,6 +153,7 @@ Returns the number of exported or overridden properties for the node at [code]idx[/code]. + The [code]prop_idx[/code] argument used to query node property data in other [code]get_node_property_*[/code] methods in the interval [code][0, get_node_property_count() - 1][/code]. diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index a236d776c7..b37fd239d1 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -1,10 +1,12 @@ - SceneTree manages a hierarchy of nodes. + 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. a "enemy" group. You can then iterate these groups or even call methods and set properties on all the group's members at once. + 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. a "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. https://docs.godotengine.org/en/latest/getting_started/step_by_step/scene_tree.html @@ -41,7 +43,8 @@ - Changes to the scene at the given [code]path[/code]. + Changes the running scene to the one at the given [code]path[/code], after loading it into a [PackedScene] and creating a new instance. + Returns [constant @GlobalScope.OK] on success, [constant @GlobalScope.ERR_CANT_OPEN] if the [code]path[/code] cannot be loaded into a [PackedScene], or [constant @GlobalScope.ERR_CANT_CREATE] if that scene cannot be instantiated. @@ -50,7 +53,8 @@ - Changes to the given [PackedScene]. + Changes the running scene to a new instance of the given [PackedScene]. + Returns [constant @GlobalScope.OK] on success or [constant @GlobalScope.ERR_CANT_CREATE] if the scene cannot be instantiated. @@ -61,7 +65,7 @@ - Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this SceneTree. If [code]pause_mode_process[/code] is set to [code]false[/code], pausing the SceneTree will also pause the timer. + Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this [SceneTree]. If [code]pause_mode_process[/code] is set to [code]false[/code], pausing the [SceneTree] will also pause the timer. Commonly used to create a one-shot delay timer as in the following example: [codeblock] func some_function(): @@ -75,28 +79,28 @@ - Returns the current frame, i.e. number of frames since the application started. + 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 [member network_peer]. + Returns the peer IDs of all connected peers of this [SceneTree]'s [member network_peer]. - Returns the unique peer ID of this SceneTree's [member network_peer]. + Returns the unique peer ID of this [SceneTree]'s [member network_peer]. - Returns the number of nodes in this SceneTree. + Returns the number of nodes in this [SceneTree]. @@ -105,7 +109,7 @@ - Returns all nodes assigned to the given group. + Returns a list of all nodes assigned to the given group. @@ -135,14 +139,14 @@ - Returns [code]true[/code] if the most recent InputEvent was marked as handled with [method set_input_as_handled]. + Returns [code]true[/code] if the most recent [InputEvent] was marked as handled with [method set_input_as_handled]. - Returns [code]true[/code] if this SceneTree's [member network_peer] is in server mode (listening for connections). + Returns [code]true[/code] if this [SceneTree]'s [member network_peer] is in server mode (listening for connections). @@ -190,6 +194,7 @@ Reloads the currently active scene. + Returns an [enum @GlobalScope.Error] code as described in [method change_scene], with the addition of [constant @GlobalScope.ERR_UNCONFIGURED] if no [member current_scene] was defined yet. @@ -198,7 +203,7 @@ - If [code]true[/code], the application automatically accepts quitting. + If [code]true[/code], the application automatically accepts quitting. Defaults to [code]true[/code]. @@ -233,7 +238,7 @@ - Marks the most recent input event as handled. + Marks the most recent [InputEvent] as handled. @@ -242,7 +247,7 @@ - If [code]true[/code], the application quits automatically on going back (e.g. on Android). + If [code]true[/code], the application quits automatically on going back (e.g. on Android). Defaults to [code]true[/code]. @@ -257,7 +262,7 @@ - Configures screen stretching to the given [enum StretchMode], [enum StretchAspect], minimum size and [code]shrink[/code]. + Configures screen stretching to the given [enum StretchMode], [enum StretchAspect], minimum size and [code]shrink[/code] ratio. @@ -266,34 +271,34 @@ The current scene. + If [code]true[/code], collision shapes will be visible when running the game from the editor for debugging purposes. + If [code]true[/code], 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. + The default [MultiplayerAPI] instance for this [SceneTree]. - If [code]true[/code], (default) enable the automatic polling of the [MultiplayerAPI] for this SceneTree during [signal idle_frame]. + If [code]true[/code] (default value), enable the automatic polling of the [MultiplayerAPI] for this [SceneTree] during [signal idle_frame]. When [code]false[/code] you need to manually call [method MultiplayerAPI.poll] for processing network packets and delivering RPCs/RSETs. This allows to run 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 [method is_network_server]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with 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. + 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 [method is_network_server]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with 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 [code]true[/code], the SceneTree is paused. - Doing so will have the following behavior: - * 2D and 3D physics will be stopped. - * _process and _physics_process will not be called anymore in nodes. - * _input and _input_event will not be called anymore either. + If [code]true[/code], the [SceneTree] is paused. Doing so will have the following behavior: + - 2D and 3D physics will be stopped. + - [method Node._process], [method Node._physics_process] and [method Node._input] will not be called anymore in nodes. - If [code]true[/code], the SceneTree's [member network_peer] refuses new incoming connections. + If [code]true[/code], the [SceneTree]'s [member network_peer] refuses new incoming connections. - The SceneTree's [Viewport]. + The [SceneTree]'s root [Viewport]. If [code]true[/code], font oversampling is used. @@ -302,12 +307,12 @@ - Emitted whenever this SceneTree's [member network_peer] successfully connected to a server. Only emitted on clients. + Emitted whenever this [SceneTree]'s [member network_peer] successfully connected to a server. Only emitted on clients. - Emitted whenever this SceneTree's [member network_peer] fails to establish a connection to a server. Only emitted on clients. + Emitted whenever this [SceneTree]'s [member network_peer] fails to establish a connection to a server. Only emitted on clients. @@ -316,33 +321,33 @@ - Emitted whenever files are drag-and-dropped onto the window. + Emitted when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated. - Emitted immediately before [method Node._process] is called on every node in the SceneTree. + Emitted immediately before [method Node._process] is called on every node in the [SceneTree]. - Emitted whenever this SceneTree's [member network_peer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1). + Emitted whenever this [SceneTree]'s [member network_peer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1). - Emitted whenever this SceneTree's [member network_peer] disconnects from a peer. Clients get notified when other clients disconnect from the same server. + Emitted whenever this [SceneTree]'s [member network_peer] disconnects from a peer. Clients get notified when other clients disconnect from the same server. - Emitted whenever a node is added to the SceneTree. + Emitted whenever a node is added to the [SceneTree]. @@ -356,18 +361,19 @@ - Emitted whenever a node is removed from the SceneTree. + Emitted whenever a node is removed from the [SceneTree]. + Emitted whenever a node is renamed. - Emitted immediately before [method Node._physics_process] is called on every node in the SceneTree. + Emitted immediately before [method Node._physics_process] is called on every node in the [SceneTree]. @@ -377,12 +383,12 @@ - Emitted whenever this SceneTree's [member network_peer] disconnected from server. Only emitted on clients. + Emitted whenever this [SceneTree]'s [member network_peer] disconnected from server. Only emitted on clients. - Emitted whenever the SceneTree hierarchy changed (children being moved or renamed, etc.). + Emitted whenever the [SceneTree] hierarchy changed (children being moved or renamed, etc.). diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index b6e458b43f..71da4c684c 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -1,12 +1,12 @@ - Helper to manage UndoRedo in the editor or custom tools. + Helper to manage undo/redo operations in the editor or custom tools. - Helper to manage UndoRedo in the editor or custom tools. It works by registering methods and property changes inside 'actions'. + Helper to manage undo/redo operations in the editor or custom tools. It works by registering methods and property changes inside 'actions'. Common behavior is to create an action, then add do/undo calls to functions or property changes, then committing the action. - Here's an example on how to add an action to Godot editor's own 'undoredo': + Here's an example on how to add an action to the Godot editor's own [UndoRedo], from a plugin: [codeblock] var undo_redo = get_undo_redo() # Method of EditorPlugin. @@ -137,7 +137,7 @@ - Get the version, each time a new action is committed, the version number of the UndoRedo is increased automatically. + Get the version, each time a new action is committed, the version number of the [UndoRedo] is increased automatically. This is useful mostly to check if something changed from a saved version. @@ -145,7 +145,7 @@ - Returns [code]true[/code] if an 'redo' action is available. + Returns [code]true[/code] if a 'redo' action is available. @@ -159,20 +159,21 @@ + Returns [code]true[/code] if the [UndoRedo] is currently committing the action, i.e. running its 'do' method or property change (see [method commit_action]). - Redo last action. + Redo the last action. - Undo last action. + Undo the last action. @@ -185,10 +186,10 @@ - Makes [code]do[/code]/[code]undo[/code] operations stay in separate actions. + Makes 'do'/'undo' operations stay in separate actions. - Makes so that the action's [code]do[/code] operation is from the first action created and the [code]undo[/code] operation is from the last subsequent action with the same name. + Makes so that the action's 'do' operation is from the first action created and the 'undo' operation is from the last subsequent action with the same name. Makes subsequent actions with the same name be merged into one. diff --git a/doc/classes/VehicleBody.xml b/doc/classes/VehicleBody.xml index ab821aafdc..f5b26e4f11 100644 --- a/doc/classes/VehicleBody.xml +++ b/doc/classes/VehicleBody.xml @@ -1,7 +1,7 @@ - Physics body that simulates the behaviour of a car. + Physics body that simulates the behavior of a car. This nodes implements all the physics logic needed to simulate a car. It is based on the raycast vehicle system commonly found in physics engines. You will need to add a [CollisionShape] for the main body of your vehicle and add [VehicleWheel] nodes for the wheels. You should also add a [MeshInstance] to this node for the 3D model of your car but this model should not include meshes for the wheels. You should control the vehicle by using the [member brake], [member engine_force], and [member steering] properties and not change the position or orientation of this node directly. diff --git a/doc/classes/VehicleWheel.xml b/doc/classes/VehicleWheel.xml index 0bc0e351e4..eee72db48e 100644 --- a/doc/classes/VehicleWheel.xml +++ b/doc/classes/VehicleWheel.xml @@ -1,10 +1,10 @@ - Physics object that simulates the behaviour of a wheel. + Physics object that simulates the behavior of a wheel. - This node needs to be used as a child node of [VehicleBody] and simulates the behaviour of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface. + This node needs to be used as a child node of [VehicleBody] and simulates the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface. diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml index f9b668b38a..e7a4da0677 100644 --- a/doc/classes/VisualServer.xml +++ b/doc/classes/VisualServer.xml @@ -4388,9 +4388,10 @@ The amount of draw calls in frame. + Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0. - The amount of vertex memory and texture memory used. + The amount of video memory used, i.e. texture and vertex memory combined. The amount of texture memory used.