diff options
Diffstat (limited to 'doc/classes')
40 files changed, 434 insertions, 326 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index d4680d1836..46b9bdd52d 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2458,6 +2458,8 @@ </constant> <constant name="METHOD_FLAG_STATIC" value="256" enum="MethodFlags"> </constant> + <constant name="METHOD_FLAG_OBJECT_CORE" value="512" enum="MethodFlags"> + </constant> <constant name="METHOD_FLAGS_DEFAULT" value="1" enum="MethodFlags"> Default method flags. </constant> diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index 63dd250dbc..3e91184a65 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -38,7 +38,7 @@ <tutorials> </tutorials> <methods> - <method name="_compute_cost" qualifiers="virtual"> + <method name="_compute_cost" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> @@ -47,7 +47,7 @@ Note that this function is hidden in the default [code]AStar[/code] class. </description> </method> - <method name="_estimate_cost" qualifiers="virtual"> + <method name="_estimate_cost" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 31d695b051..453e8b6315 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -9,7 +9,7 @@ <tutorials> </tutorials> <methods> - <method name="_compute_cost" qualifiers="virtual"> + <method name="_compute_cost" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> @@ -18,7 +18,7 @@ Note that this function is hidden in the default [code]AStar2D[/code] class. </description> </method> - <method name="_estimate_cost" qualifiers="virtual"> + <method name="_estimate_cost" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index a9a08efcf1..173ff43d2a 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -11,46 +11,46 @@ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> - <method name="_get_caption" qualifiers="virtual"> + <method name="_get_caption" qualifiers="virtual const"> <return type="String" /> <description> Gets the text caption for this node (used by some editors). </description> </method> - <method name="_get_child_by_name" qualifiers="virtual"> - <return type="Object" /> - <argument index="0" name="name" type="String" /> + <method name="_get_child_by_name" qualifiers="virtual const"> + <return type="AnimationNode" /> + <argument index="0" name="name" type="StringName" /> <description> Gets a child node by index (used by editors inheriting from [AnimationRootNode]). </description> </method> - <method name="_get_child_nodes" qualifiers="virtual"> + <method name="_get_child_nodes" qualifiers="virtual const"> <return type="Dictionary" /> <description> Gets all children nodes in order as a [code]name: node[/code] dictionary. Only useful when inheriting [AnimationRootNode]. </description> </method> - <method name="_get_parameter_default_value" qualifiers="virtual"> + <method name="_get_parameter_default_value" qualifiers="virtual const"> <return type="Variant" /> - <argument index="0" name="name" type="StringName" /> + <argument index="0" name="parameter" type="StringName" /> <description> Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. </description> </method> - <method name="_get_parameter_list" qualifiers="virtual"> + <method name="_get_parameter_list" qualifiers="virtual const"> <return type="Array" /> <description> Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list]. </description> </method> - <method name="_has_filter" qualifiers="virtual"> + <method name="_has_filter" qualifiers="virtual const"> <return type="bool" /> <description> Returns [code]true[/code] whether you want the blend tree editor to display filter editing on this node. </description> </method> - <method name="_process" qualifiers="virtual"> - <return type="void" /> + <method name="_process" qualifiers="virtual const"> + <return type="float" /> <argument index="0" name="time" type="float" /> <argument index="1" name="seek" type="bool" /> <description> diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index e23ceedc28..e5f60541b9 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -111,6 +111,7 @@ This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. Modifies [member linear_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision]. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. + The general behaviour and available properties change according to the [member motion_mode]. Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code]. </description> </method> @@ -139,12 +140,18 @@ <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="false"> If [code]true[/code], the body will not slide on floor's slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still. </member> + <member name="free_mode_min_slide_angle" type="float" setter="set_free_mode_min_slide_angle" getter="get_free_mode_min_slide_angle" default="0.261799"> + Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. + </member> <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2(0, 0)"> Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. </member> <member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="4"> Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. </member> + <member name="motion_mode" type="int" setter="set_motion_mode" getter="get_motion_mode" enum="CharacterBody2D.MotionMode" default="0"> + Sets the motion mode which defines the behaviour of [method move_and_slide]. See [enum MotionMode] constants for available modes. + </member> <member name="moving_platform_ignore_layers" type="int" setter="set_moving_platform_ignore_layers" getter="get_moving_platform_ignore_layers" default="0"> Collision layers that will be excluded for detecting bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all touching bodies are detected and propagate their velocity. You can add excluded layers to ignore bodies that are contained in these layers. </member> @@ -156,5 +163,11 @@ </member> </members> <constants> + <constant name="MOTION_MODE_GROUNDED" value="0" enum="MotionMode"> + Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for sided games like platformers. + </constant> + <constant name="MOTION_MODE_FREE" value="1" enum="MotionMode"> + Apply when there is no notion of floor or ceiling. All collisions will be reported as [code]on_wall[/code]. In this mode, when you slide, the speed will be always constant. This mode is suitable for top-down games. + </constant> </constants> </class> diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 47078330f3..93f72d45ae 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -17,9 +17,9 @@ Override this method to define how the selected entry should be inserted. If [code]replace[/code] is true, any existing text should be replaced. </description> </method> - <method name="_filter_code_completion_candidates" qualifiers="virtual"> + <method name="_filter_code_completion_candidates" qualifiers="virtual const"> <return type="Array" /> - <argument index="0" name="candidates" type="Array" /> + <argument index="0" name="candidates" type="Dictionary[]" /> <description> Override this method to define what items in [code]candidates[/code] should be displayed. Both [code]candidates[/code] and the return is a [Array] of [Dictionary], see [method get_code_completion_option] for [Dictionary] content. diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index 99e121de75..571ffd592a 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -116,7 +116,7 @@ </theme_item> <theme_item name="picker_cursor" data_type="icon" type="Texture2D"> </theme_item> - <theme_item name="preset_bg" data_type="icon" type="Texture2D"> + <theme_item name="sample_bg" data_type="icon" type="Texture2D"> </theme_item> <theme_item name="screen_picker" data_type="icon" type="Texture2D"> The icon for the screen color picker button. diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 0834521c91..5392189f6a 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -22,9 +22,9 @@ <link title="All GUI Demos">https://github.com/godotengine/godot-demo-projects/tree/master/gui</link> </tutorials> <methods> - <method name="_can_drop_data" qualifiers="virtual"> + <method name="_can_drop_data" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="position" type="Vector2" /> + <argument index="0" name="at_position" type="Vector2" /> <argument index="1" name="data" type="Variant" /> <description> Godot calls this method to test if [code]data[/code] from a control's [method _get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control. @@ -49,7 +49,7 @@ </method> <method name="_drop_data" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="position" type="Vector2" /> + <argument index="0" name="at_position" type="Vector2" /> <argument index="1" name="data" type="Variant" /> <description> Godot calls this method to pass you the [code]data[/code] from a control's [method _get_drag_data] result. Godot first calls [method _can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control. @@ -73,9 +73,9 @@ [/codeblocks] </description> </method> - <method name="_get_drag_data" qualifiers="virtual"> + <method name="_get_drag_data" qualifiers="virtual const"> <return type="Variant" /> - <argument index="0" name="position" type="Vector2" /> + <argument index="0" name="at_position" type="Vector2" /> <description> Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method _can_drop_data] and [method _drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag]. A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method. @@ -97,7 +97,7 @@ [/codeblocks] </description> </method> - <method name="_get_minimum_size" qualifiers="virtual"> + <method name="_get_minimum_size" qualifiers="virtual const"> <return type="Vector2" /> <description> Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member rect_min_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). @@ -141,15 +141,15 @@ </method> <method name="_has_point" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="" type="Vector2" /> + <argument index="0" name="position" type="Vector2" /> <description> Virtual method to be implemented by the user. Returns whether the given [code]point[/code] is inside this control. If not overridden, default behavior is checking if the point is within control's Rect. [b]Note:[/b] If you want to check if a point is inside the control, you can use [code]get_rect().has_point(point)[/code]. </description> </method> - <method name="_make_custom_tooltip" qualifiers="virtual"> - <return type="Control" /> + <method name="_make_custom_tooltip" qualifiers="virtual const"> + <return type="Object" /> <argument index="0" name="for_text" type="String" /> <description> Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [code]for_text[/code] includes the contents of the [member hint_tooltip] property. @@ -193,8 +193,8 @@ [/codeblocks] </description> </method> - <method name="_structured_text_parser" qualifiers="virtual"> - <return type="void" /> + <method name="_structured_text_parser" qualifiers="virtual const"> + <return type="Array" /> <argument index="0" name="args" type="Array" /> <argument index="1" name="text" type="String" /> <description> diff --git a/doc/classes/DirectionalLight3D.xml b/doc/classes/DirectionalLight3D.xml index 0060368207..e3badea0f4 100644 --- a/doc/classes/DirectionalLight3D.xml +++ b/doc/classes/DirectionalLight3D.xml @@ -36,7 +36,7 @@ <member name="directional_shadow_split_3" type="float" setter="set_param" getter="get_param" default="0.5"> The distance from shadow split 2 to split 3. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]. </member> - <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" override="true" default="1.0" /> + <member name="shadow_bias" type="float" setter="set_param" getter="get_param" override="true" default="0.1" /> <member name="use_in_sky_only" type="bool" setter="set_sky_only" getter="is_sky_only" default="false"> If [code]true[/code], this [DirectionalLight3D] will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon. </member> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index abb715b34e..4f495eaec9 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -649,6 +649,8 @@ <argument index="0" name="min_size" type="Vector2i" /> <argument index="1" name="window_id" type="int" default="0" /> <description> + Sets the minimum size for the given window to [code]min_size[/code] (in pixels). + [b]Note:[/b] By default, the main window has a minimum size of [code]Vector2i(64, 64)[/code]. This prevents issues that can arise when the window is resized to a near-zero size. </description> </method> <method name="window_set_mode"> diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml index b379ccc8c6..da6738d6b7 100644 --- a/doc/classes/EditorImportPlugin.xml +++ b/doc/classes/EditorImportPlugin.xml @@ -113,28 +113,28 @@ <link title="Import plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link> </tutorials> <methods> - <method name="_get_import_options" qualifiers="virtual"> + <method name="_get_import_options" qualifiers="virtual const"> <return type="Array" /> - <argument index="0" name="preset" type="int" /> + <argument index="0" name="preset_index" type="int" /> <description> Gets the options and default values for the preset at this index. Returns an Array of Dictionaries with the following keys: [code]name[/code], [code]default_value[/code], [code]property_hint[/code] (optional), [code]hint_string[/code] (optional), [code]usage[/code] (optional). </description> </method> - <method name="_get_import_order" qualifiers="virtual"> + <method name="_get_import_order" qualifiers="virtual const"> <return type="int" /> <description> Gets the order of this importer to be run when importing resources. Importers with [i]lower[/i] import orders will be called first, and higher values will be called later. Use this to ensure the importer runs after the dependencies are already imported. The default import order is [code]0[/code] unless overridden by a specific importer. See [enum ResourceImporter.ImportOrder] for some predefined values. </description> </method> - <method name="_get_importer_name" qualifiers="virtual"> + <method name="_get_importer_name" qualifiers="virtual const"> <return type="String" /> <description> Gets the unique name of the importer. </description> </method> - <method name="_get_option_visibility" qualifiers="virtual"> + <method name="_get_option_visibility" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="option" type="String" /> + <argument index="0" name="option_name" type="StringName" /> <argument index="1" name="options" type="Dictionary" /> <description> This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example: @@ -163,50 +163,50 @@ Return [code]true[/code] to make all options always visible. </description> </method> - <method name="_get_preset_count" qualifiers="virtual"> + <method name="_get_preset_count" qualifiers="virtual const"> <return type="int" /> <description> Gets the number of initial presets defined by the plugin. Use [method _get_import_options] to get the default options for the preset and [method _get_preset_name] to get the name of the preset. </description> </method> - <method name="_get_preset_name" qualifiers="virtual"> + <method name="_get_preset_name" qualifiers="virtual const"> <return type="String" /> - <argument index="0" name="preset" type="int" /> + <argument index="0" name="preset_index" type="int" /> <description> Gets the name of the options preset at this index. </description> </method> - <method name="_get_priority" qualifiers="virtual"> + <method name="_get_priority" qualifiers="virtual const"> <return type="float" /> <description> Gets the priority of this plugin for the recognized extension. Higher priority plugins will be preferred. The default priority is [code]1.0[/code]. </description> </method> - <method name="_get_recognized_extensions" qualifiers="virtual"> - <return type="Array" /> + <method name="_get_recognized_extensions" qualifiers="virtual const"> + <return type="PackedStringArray" /> <description> Gets the list of file extensions to associate with this loader (case-insensitive). e.g. [code]["obj"][/code]. </description> </method> - <method name="_get_resource_type" qualifiers="virtual"> + <method name="_get_resource_type" qualifiers="virtual const"> <return type="String" /> <description> Gets the Godot resource type associated with this loader. e.g. [code]"Mesh"[/code] or [code]"Animation"[/code]. </description> </method> - <method name="_get_save_extension" qualifiers="virtual"> + <method name="_get_save_extension" qualifiers="virtual const"> <return type="String" /> <description> Gets the extension used to save this resource in the [code].godot/imported[/code] directory. </description> </method> - <method name="_get_visible_name" qualifiers="virtual"> + <method name="_get_visible_name" qualifiers="virtual const"> <return type="String" /> <description> Gets the name to display in the import window. You should choose this name as a continuation to "Import as", e.g. "Import as Special Mesh". </description> </method> - <method name="_import" qualifiers="virtual"> + <method name="_import" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="source_file" type="String" /> <argument index="1" name="save_path" type="String" /> diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index 62fd7a1d6e..ee93379210 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -16,9 +16,9 @@ <link title="Inspector plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/inspector_plugins.html</link> </tutorials> <methods> - <method name="_can_handle" qualifiers="virtual"> + <method name="_can_handle" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="object" type="Object" /> + <argument index="0" name="object" type="Variant" /> <description> Returns [code]true[/code] if this object can be handled by this plugin. </description> @@ -31,9 +31,9 @@ </method> <method name="_parse_category" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="category" type="String" /> + <argument index="0" name="object" type="Object" /> + <argument index="1" name="category" type="String" /> <description> - Called to allow adding controls at the beginning of the category. </description> </method> <method name="_parse_end" qualifiers="virtual"> @@ -44,11 +44,13 @@ </method> <method name="_parse_property" qualifiers="virtual"> <return type="bool" /> - <argument index="0" name="type" type="int" /> - <argument index="1" name="path" type="String" /> - <argument index="2" name="hint" type="int" /> - <argument index="3" name="hint_text" type="String" /> - <argument index="4" name="usage" type="int" /> + <argument index="0" name="object" type="Object" /> + <argument index="1" name="type" type="int" /> + <argument index="2" name="name" type="String" /> + <argument index="3" name="hint_type" type="int" /> + <argument index="4" name="hint_string" type="String" /> + <argument index="5" name="usage_flags" type="int" /> + <argument index="6" name="wide" type="bool" /> <description> Called to allow adding property specific editors to the inspector. Usually these inherit [EditorProperty]. Returning [code]true[/code] removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one. </description> diff --git a/doc/classes/EditorNode3DGizmo.xml b/doc/classes/EditorNode3DGizmo.xml index 39f6805254..91e024cc1c 100644 --- a/doc/classes/EditorNode3DGizmo.xml +++ b/doc/classes/EditorNode3DGizmo.xml @@ -13,7 +13,7 @@ <return type="void" /> <argument index="0" name="id" type="int" /> <argument index="1" name="restore" type="Variant" /> - <argument index="2" name="cancel" type="bool" default="false" /> + <argument index="2" name="cancel" type="bool" /> <description> Override this method to commit a handle being edited (handles must have been previously added by [method add_handles]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [code]restore[/code] argument as "undo". If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action. @@ -22,14 +22,14 @@ <method name="_commit_subgizmos" qualifiers="virtual"> <return type="void" /> <argument index="0" name="ids" type="PackedInt32Array" /> - <argument index="1" name="restore" type="Array" /> - <argument index="2" name="cancel" type="bool" default="false" /> + <argument index="1" name="restores" type="Transform3D[]" /> + <argument index="2" name="cancel" type="bool" /> <description> Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [code]restore[/code] transforms as "undo". If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] transforms should be directly set, without any [UndoRedo] action. </description> </method> - <method name="_get_handle_name" qualifiers="virtual"> + <method name="_get_handle_name" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="id" type="int" /> <description> @@ -37,21 +37,21 @@ Handles can be named for reference to the user when editing. </description> </method> - <method name="_get_handle_value" qualifiers="virtual"> + <method name="_get_handle_value" qualifiers="virtual const"> <return type="Variant" /> <argument index="0" name="id" type="int" /> <description> Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle]. </description> </method> - <method name="_get_subgizmo_transform" qualifiers="virtual"> + <method name="_get_subgizmo_transform" qualifiers="virtual const"> <return type="Transform3D" /> <argument index="0" name="id" type="int" /> <description> Override this method to return the current transform of a subgizmo. This transform will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_subgizmos]. </description> </method> - <method name="_is_handle_highlighted" qualifiers="virtual"> + <method name="_is_handle_highlighted" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="id" type="int" /> <description> @@ -81,15 +81,15 @@ Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [code]transform[/code] is given in the Node3D's local coordinate system. </description> </method> - <method name="_subgizmos_intersect_frustum" qualifiers="virtual"> + <method name="_subgizmos_intersect_frustum" qualifiers="virtual const"> <return type="PackedInt32Array" /> <argument index="0" name="camera" type="Camera3D" /> - <argument index="1" name="frustum" type="Array" /> + <argument index="1" name="frustum" type="Plane[]" /> <description> Override this method to allow selecting subgizmos using mouse drag box selection. Given a [code]camera[/code] and a [code]frustum[/code], this method should return which subgizmos are contained within the frustum. The [code]frustum[/code] argument consists of an [code]Array[/code] with all the [code]Plane[/code]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. </description> </method> - <method name="_subgizmos_intersect_ray" qualifiers="virtual"> + <method name="_subgizmos_intersect_ray" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="camera" type="Camera3D" /> <argument index="1" name="point" type="Vector2" /> diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml index fb72427a7a..4ba455a336 100644 --- a/doc/classes/EditorNode3DGizmoPlugin.xml +++ b/doc/classes/EditorNode3DGizmoPlugin.xml @@ -10,7 +10,7 @@ <link title="Spatial gizmo plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link> </tutorials> <methods> - <method name="_can_be_hidden" qualifiers="virtual"> + <method name="_can_be_hidden" qualifiers="virtual const"> <return type="bool" /> <description> Override this method to define whether the gizmos handled by this plugin can be hidden or not. Returns [code]true[/code] if not overridden. @@ -19,9 +19,9 @@ <method name="_commit_handle" qualifiers="virtual"> <return type="void" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="handle_id" type="int" /> <argument index="2" name="restore" type="Variant" /> - <argument index="3" name="cancel" type="bool" default="false" /> + <argument index="3" name="cancel" type="bool" /> <description> Override this method to commit a handle being edited (handles must have been previously added by [method EditorNode3DGizmo.add_handles] during [method _redraw]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [code]restore[/code] argument as "undo". If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action. Called for this plugin's active gizmos. @@ -31,73 +31,73 @@ <return type="void" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> <argument index="1" name="ids" type="PackedInt32Array" /> - <argument index="2" name="restore" type="Array" /> - <argument index="3" name="cancel" type="bool" default="false" /> + <argument index="2" name="restores" type="Transform3D[]" /> + <argument index="3" name="cancel" type="bool" /> <description> Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [code]restore[/code] transforms as "undo". If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] transforms should be directly set, without any [UndoRedo] action. As with all subgizmo methods, transforms are given in local space respect to the gizmo's Node3D. Called for this plugin's active gizmos. </description> </method> - <method name="_create_gizmo" qualifiers="virtual"> + <method name="_create_gizmo" qualifiers="virtual const"> <return type="EditorNode3DGizmo" /> - <argument index="0" name="spatial" type="Node3D" /> + <argument index="0" name="for_node_3d" type="Node3D" /> <description> Override this method to return a custom [EditorNode3DGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. See also [method _has_gizmo]. </description> </method> - <method name="_get_gizmo_name" qualifiers="virtual"> + <method name="_get_gizmo_name" qualifiers="virtual const"> <return type="String" /> <description> Override this method to provide the name that will appear in the gizmo visibility menu. </description> </method> - <method name="_get_handle_name" qualifiers="virtual"> + <method name="_get_handle_name" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="handle_id" type="int" /> <description> Override this method to provide gizmo's handle names. Called for this plugin's active gizmos. </description> </method> - <method name="_get_handle_value" qualifiers="virtual"> + <method name="_get_handle_value" qualifiers="virtual const"> <return type="Variant" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="handle_id" type="int" /> <description> Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle]. Called for this plugin's active gizmos. </description> </method> - <method name="_get_priority" qualifiers="virtual"> + <method name="_get_priority" qualifiers="virtual const"> <return type="int" /> <description> Override this method to set the gizmo's priority. Gizmos with higher priority will have precedence when processing inputs like handles or subgizmos selection. All built-in editor gizmos return a priority of [code]-1[/code]. If not overridden, this method will return [code]0[/code], which means custom gizmos will automatically get higher priority than built-in gizmos. </description> </method> - <method name="_get_subgizmo_transform" qualifiers="virtual"> + <method name="_get_subgizmo_transform" qualifiers="virtual const"> <return type="Transform3D" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="subgizmo_id" type="int" /> <description> Override this method to return the current transform of a subgizmo. As with all subgizmo methods, the transform should be in local space respect to the gizmo's Node3D. This transform will be requested at the start of an edit and used in the [code]restore[/code] argument in [method _commit_subgizmos]. Called for this plugin's active gizmos. </description> </method> - <method name="_has_gizmo" qualifiers="virtual"> + <method name="_has_gizmo" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="spatial" type="Node3D" /> + <argument index="0" name="for_node_3d" type="Node3D" /> <description> Override this method to define which Node3D nodes have a gizmo from this plugin. Whenever a [Node3D] node is added to a scene this method is called, if it returns [code]true[/code] the node gets a generic [EditorNode3DGizmo] assigned and is added to this plugin's list of active gizmos. </description> </method> - <method name="_is_handle_highlighted" qualifiers="virtual"> + <method name="_is_handle_highlighted" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="handle_id" type="int" /> <description> Override this method to return [code]true[/code] whenever to given handle should be highlighted in the editor. Called for this plugin's active gizmos. </description> </method> - <method name="_is_selectable_when_hidden" qualifiers="virtual"> + <method name="_is_selectable_when_hidden" qualifiers="virtual const"> <return type="bool" /> <description> Override this method to define whether Node3D with this gizmo should be selectable even when the gizmo is hidden. @@ -113,9 +113,9 @@ <method name="_set_handle" qualifiers="virtual"> <return type="void" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="handle_id" type="int" /> <argument index="2" name="camera" type="Camera3D" /> - <argument index="3" name="point" type="Vector2" /> + <argument index="3" name="screen_pos" type="Vector2" /> <description> Override this method to update the node's properties when the user drags a gizmo handle (previously added with [method EditorNode3DGizmo.add_handles]). The provided [code]point[/code] is the mouse position in screen coordinates and the [code]camera[/code] can be used to convert it to raycasts. Called for this plugin's active gizmos. </description> @@ -123,26 +123,26 @@ <method name="_set_subgizmo_transform" qualifiers="virtual"> <return type="void" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="subgizmo_id" type="int" /> <argument index="2" name="transform" type="Transform3D" /> <description> Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [code]transform[/code] is given in the Node3D's local coordinate system. Called for this plugin's active gizmos. </description> </method> - <method name="_subgizmos_intersect_frustum" qualifiers="virtual"> + <method name="_subgizmos_intersect_frustum" qualifiers="virtual const"> <return type="PackedInt32Array" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> <argument index="1" name="camera" type="Camera3D" /> - <argument index="2" name="frustum" type="Array" /> + <argument index="2" name="frustum_planes" type="Plane[]" /> <description> Override this method to allow selecting subgizmos using mouse drag box selection. Given a [code]camera[/code] and a [code]frustum[/code], this method should return which subgizmos are contained within the frustum. The [code]frustum[/code] argument consists of an [code]Array[/code] with all the [code]Plane[/code]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, these identifiers can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos. </description> </method> - <method name="_subgizmos_intersect_ray" qualifiers="virtual"> + <method name="_subgizmos_intersect_ray" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> <argument index="1" name="camera" type="Camera3D" /> - <argument index="2" name="point" type="Vector2" /> + <argument index="2" name="screen_pos" type="Vector2" /> <description> Override this method to allow selecting subgizmos using mouse clicks. Given a [code]camera[/code] and a [code]point[/code] in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos. </description> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 37efca7f48..e564e8045c 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -38,7 +38,7 @@ </method> <method name="_edit" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="object" type="Object" /> + <argument index="0" name="object" type="Variant" /> <description> This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object. </description> @@ -49,18 +49,18 @@ Called by the engine when the user enables the [EditorPlugin] in the Plugin tab of the project settings window. </description> </method> - <method name="_forward_canvas_draw_over_viewport" qualifiers="virtual"> + <method name="_forward_3d_draw_over_viewport" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="overlay" type="Control" /> + <argument index="0" name="viewport_control" type="Control" /> <description> - Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. + Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. [codeblocks] [gdscript] - func _forward_canvas_draw_over_viewport(overlay): + func _forward_spatial_3d_over_viewport(overlay): # Draw a circle at cursor position. - overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white) + overlay.draw_circle(overlay.get_local_mouse_position(), 64) - func _forward_canvas_gui_input(event): + func _forward_spatial_gui_input(camera, event): if event is InputEventMouseMotion: # Redraw viewport when cursor is moved. update_overlays() @@ -68,13 +68,13 @@ return false [/gdscript] [csharp] - public override void ForwardCanvasDrawOverViewport(Godot.Control overlay) + public override void ForwardSpatialDrawOverViewport(Godot.Control overlay) { // Draw a circle at cursor position. overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White); } - public override bool ForwardCanvasGuiInput(InputEvent @event) + public override bool ForwardSpatialGuiInput(Godot.Camera3D camera, InputEvent @event) { if (@event is InputEventMouseMotion) { @@ -87,28 +87,29 @@ [/codeblocks] </description> </method> - <method name="_forward_canvas_force_draw_over_viewport" qualifiers="virtual"> + <method name="_forward_3d_force_draw_over_viewport" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="overlay" type="Control" /> + <argument index="0" name="viewport_control" type="Control" /> <description> - This method is the same as [method _forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + This method is the same as [method _forward_3d_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. </description> </method> - <method name="_forward_canvas_gui_input" qualifiers="virtual"> + <method name="_forward_3d_gui_input" qualifiers="virtual"> <return type="bool" /> - <argument index="0" name="event" type="InputEvent" /> + <argument index="0" name="viewport_camera" type="Camera3D" /> + <argument index="1" name="event" type="InputEvent" /> <description> - Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: + Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: [codeblocks] [gdscript] - # Prevents the InputEvent to reach other Editor classes - func _forward_canvas_gui_input(event): + # Prevents the InputEvent to reach other Editor classes. + func _forward_spatial_gui_input(camera, event): return true [/gdscript] [csharp] - // Prevents the InputEvent to reach other Editor classes - public override bool ForwardCanvasGuiInput(InputEvent @event) + // Prevents the InputEvent to reach other Editor classes. + public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event) { return true; } @@ -118,12 +119,12 @@ [codeblocks] [gdscript] # Consumes InputEventMouseMotion and forwards other InputEvent types. - func _forward_canvas_gui_input(event): + func _forward_spatial_gui_input(camera, event): return event is InputEventMouseMotion [/gdscript] [csharp] // Consumes InputEventMouseMotion and forwards other InputEvent types. - public override bool ForwardCanvasGuiInput(InputEvent @event) + public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event) { return @event is InputEventMouseMotion; } @@ -131,18 +132,18 @@ [/codeblocks] </description> </method> - <method name="_forward_spatial_draw_over_viewport" qualifiers="virtual"> + <method name="_forward_canvas_draw_over_viewport" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="overlay" type="Control" /> + <argument index="0" name="viewport_control" type="Control" /> <description> - Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. + Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. [codeblocks] [gdscript] - func _forward_spatial_draw_over_viewport(overlay): + func _forward_canvas_draw_over_viewport(overlay): # Draw a circle at cursor position. - overlay.draw_circle(overlay.get_local_mouse_position(), 64) + overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white) - func _forward_spatial_gui_input(camera, event): + func _forward_canvas_gui_input(event): if event is InputEventMouseMotion: # Redraw viewport when cursor is moved. update_overlays() @@ -150,13 +151,13 @@ return false [/gdscript] [csharp] - public override void ForwardSpatialDrawOverViewport(Godot.Control overlay) + public override void ForwardCanvasDrawOverViewport(Godot.Control overlay) { // Draw a circle at cursor position. overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White); } - public override bool ForwardSpatialGuiInput(Godot.Camera3D camera, InputEvent @event) + public override bool ForwardCanvasGuiInput(InputEvent @event) { if (@event is InputEventMouseMotion) { @@ -169,29 +170,28 @@ [/codeblocks] </description> </method> - <method name="_forward_spatial_force_draw_over_viewport" qualifiers="virtual"> + <method name="_forward_canvas_force_draw_over_viewport" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="overlay" type="Control" /> + <argument index="0" name="viewport_control" type="Control" /> <description> - This method is the same as [method _forward_spatial_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + This method is the same as [method _forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. </description> </method> - <method name="_forward_spatial_gui_input" qualifiers="virtual"> + <method name="_forward_canvas_gui_input" qualifiers="virtual"> <return type="bool" /> - <argument index="0" name="camera" type="Camera3D" /> - <argument index="1" name="event" type="InputEvent" /> + <argument index="0" name="event" type="InputEvent" /> <description> - Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: + Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: [codeblocks] [gdscript] - # Prevents the InputEvent to reach other Editor classes. - func _forward_spatial_gui_input(camera, event): + # Prevents the InputEvent to reach other Editor classes + func _forward_canvas_gui_input(event): return true [/gdscript] [csharp] - // Prevents the InputEvent to reach other Editor classes. - public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event) + // Prevents the InputEvent to reach other Editor classes + public override bool ForwardCanvasGuiInput(InputEvent @event) { return true; } @@ -201,12 +201,12 @@ [codeblocks] [gdscript] # Consumes InputEventMouseMotion and forwards other InputEvent types. - func _forward_spatial_gui_input(camera, event): + func _forward_canvas_gui_input(event): return event is InputEventMouseMotion [/gdscript] [csharp] // Consumes InputEventMouseMotion and forwards other InputEvent types. - public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event) + public override bool ForwardCanvasGuiInput(InputEvent @event) { return @event is InputEventMouseMotion; } @@ -214,13 +214,13 @@ [/codeblocks] </description> </method> - <method name="_get_breakpoints" qualifiers="virtual"> + <method name="_get_breakpoints" qualifiers="virtual const"> <return type="PackedStringArray" /> <description> This is for editors that edit script-based objects. You can return a list of breakpoints in the format ([code]script:line[/code]), for example: [code]res://path_to_script.gd:25[/code]. </description> </method> - <method name="_get_plugin_icon" qualifiers="virtual"> + <method name="_get_plugin_icon" qualifiers="virtual const"> <return type="Texture2D" /> <description> Override this method in your plugin to return a [Texture2D] in order to give it an icon. @@ -246,14 +246,14 @@ [/codeblocks] </description> </method> - <method name="_get_plugin_name" qualifiers="virtual"> + <method name="_get_plugin_name" qualifiers="virtual const"> <return type="String" /> <description> Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor. For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. </description> </method> - <method name="_get_state" qualifiers="virtual"> + <method name="_get_state" qualifiers="virtual const"> <return type="Dictionary" /> <description> Gets the state of your plugin editor. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). @@ -261,19 +261,19 @@ </method> <method name="_get_window_layout" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="layout" type="ConfigFile" /> + <argument index="0" name="configuration" type="ConfigFile" /> <description> Gets the GUI layout of the plugin. This is used to save the project's editor layout when [method queue_save_layout] is called or the editor layout was changed(For example changing the position of a dock). </description> </method> - <method name="_handles" qualifiers="virtual"> + <method name="_handles" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="object" type="Object" /> + <argument index="0" name="object" type="Variant" /> <description> - Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_spatial_gui_input] these will be called too. + Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_3d_gui_input] these will be called too. </description> </method> - <method name="_has_main_screen" qualifiers="virtual"> + <method name="_has_main_screen" qualifiers="virtual const"> <return type="bool" /> <description> Returns [code]true[/code] if this is a main screen editor plugin (it goes in the workspace selector together with [b]2D[/b], [b]3D[/b], [b]Script[/b] and [b]AssetLib[/b]). @@ -302,7 +302,7 @@ </method> <method name="_set_window_layout" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="layout" type="ConfigFile" /> + <argument index="0" name="configuration" type="ConfigFile" /> <description> Restore the plugin GUI layout saved by [method _get_window_layout]. </description> @@ -586,19 +586,19 @@ <method name="set_force_draw_over_forwarding_enabled"> <return type="void" /> <description> - Enables calling of [method _forward_canvas_force_draw_over_viewport] for the 2D editor and [method _forward_spatial_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. + Enables calling of [method _forward_canvas_force_draw_over_viewport] for the 2D editor and [method _forward_3d_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. </description> </method> <method name="set_input_event_forwarding_always_enabled"> <return type="void" /> <description> - Use this method if you always want to receive inputs from 3D view screen inside [method _forward_spatial_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene. + Use this method if you always want to receive inputs from 3D view screen inside [method _forward_3d_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene. </description> </method> <method name="update_overlays" qualifiers="const"> <return type="int" /> <description> - Updates the overlays of the 2D and 3D editor viewport. Causes methods [method _forward_canvas_draw_over_viewport], [method _forward_canvas_force_draw_over_viewport], [method _forward_spatial_draw_over_viewport] and [method _forward_spatial_force_draw_over_viewport] to be called. + Updates the overlays of the 2D and 3D editor viewport. Causes methods [method _forward_canvas_draw_over_viewport], [method _forward_canvas_force_draw_over_viewport], [method _forward_3d_draw_over_viewport] and [method _forward_3d_force_draw_over_viewport] to be called. </description> </method> </methods> diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index 725b0ba8ff..822bcfd255 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -57,6 +57,11 @@ Puts the [code]editor[/code] control below the property label. The control must be previously added using [method Node.add_child]. </description> </method> + <method name="update_property"> + <return type="void" /> + <description> + </description> + </method> </methods> <members> <member name="checkable" type="bool" setter="set_checkable" getter="is_checkable" default="false"> diff --git a/doc/classes/EditorResourceConversionPlugin.xml b/doc/classes/EditorResourceConversionPlugin.xml index 3de508c88d..8543afa4ae 100644 --- a/doc/classes/EditorResourceConversionPlugin.xml +++ b/doc/classes/EditorResourceConversionPlugin.xml @@ -7,17 +7,23 @@ <tutorials> </tutorials> <methods> - <method name="_convert" qualifiers="virtual"> + <method name="_convert" qualifiers="virtual const"> <return type="Resource" /> <argument index="0" name="resource" type="Resource" /> <description> </description> </method> - <method name="_converts_to" qualifiers="virtual"> + <method name="_converts_to" qualifiers="virtual const"> <return type="String" /> <description> </description> </method> + <method name="_handles" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="resource" type="Resource" /> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/EditorResourcePreviewGenerator.xml b/doc/classes/EditorResourcePreviewGenerator.xml index 7054b1f4d0..033e03c5b5 100644 --- a/doc/classes/EditorResourcePreviewGenerator.xml +++ b/doc/classes/EditorResourcePreviewGenerator.xml @@ -9,41 +9,41 @@ <tutorials> </tutorials> <methods> - <method name="_can_generate_small_preview" qualifiers="virtual"> + <method name="_can_generate_small_preview" qualifiers="virtual const"> <return type="bool" /> <description> If this function returns [code]true[/code], the generator will call [method _generate] or [method _generate_from_path] for small previews as well. By default, it returns [code]false[/code]. </description> </method> - <method name="_generate" qualifiers="virtual"> + <method name="_generate" qualifiers="virtual const"> <return type="Texture2D" /> - <argument index="0" name="from" type="Resource" /> - <argument index="1" name="size" type="Vector2" /> + <argument index="0" name="resource" type="Resource" /> + <argument index="1" name="size" type="Vector2i" /> <description> Generate a preview from a given resource with the specified size. This must always be implemented. Returning an empty texture is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread). </description> </method> - <method name="_generate_from_path" qualifiers="virtual"> + <method name="_generate_from_path" qualifiers="virtual const"> <return type="Texture2D" /> <argument index="0" name="path" type="String" /> - <argument index="1" name="size" type="Vector2" /> + <argument index="1" name="size" type="Vector2i" /> <description> Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call [method _generate]. Returning an empty texture is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread). </description> </method> - <method name="_generate_small_preview_automatically" qualifiers="virtual"> + <method name="_generate_small_preview_automatically" qualifiers="virtual const"> <return type="bool" /> <description> If this function returns [code]true[/code], the generator will automatically generate the small previews from the normal preview texture generated by the methods [method _generate] or [method _generate_from_path]. By default, it returns [code]false[/code]. </description> </method> - <method name="_handles" qualifiers="virtual"> + <method name="_handles" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="type" type="String" /> <description> diff --git a/doc/classes/EditorSceneImporter.xml b/doc/classes/EditorSceneImporter.xml index 2e9d6a43d8..a400db551f 100644 --- a/doc/classes/EditorSceneImporter.xml +++ b/doc/classes/EditorSceneImporter.xml @@ -8,12 +8,12 @@ <tutorials> </tutorials> <methods> - <method name="_get_extensions" qualifiers="virtual"> - <return type="Array" /> + <method name="_get_extensions" qualifiers="virtual const"> + <return type="PackedStringArray" /> <description> </description> </method> - <method name="_get_import_flags" qualifiers="virtual"> + <method name="_get_import_flags" qualifiers="virtual const"> <return type="int" /> <description> </description> @@ -27,7 +27,7 @@ </description> </method> <method name="_import_scene" qualifiers="virtual"> - <return type="Node" /> + <return type="Object" /> <argument index="0" name="path" type="String" /> <argument index="1" name="flags" type="int" /> <argument index="2" name="bake_fps" type="int" /> diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml index 95b0b42d9f..43ca3db5fa 100644 --- a/doc/classes/EditorScenePostImport.xml +++ b/doc/classes/EditorScenePostImport.xml @@ -57,7 +57,7 @@ <methods> <method name="_post_import" qualifiers="virtual"> <return type="Object" /> - <argument index="0" name="scene" type="Object" /> + <argument index="0" name="scene" type="Node" /> <description> Called after the scene was imported. This method must return the modified version of the scene. </description> diff --git a/doc/classes/EditorSyntaxHighlighter.xml b/doc/classes/EditorSyntaxHighlighter.xml index 37644a8595..394a4ada46 100644 --- a/doc/classes/EditorSyntaxHighlighter.xml +++ b/doc/classes/EditorSyntaxHighlighter.xml @@ -5,24 +5,18 @@ </brief_description> <description> Base syntax highlighter resource all editor syntax highlighters extend from, it is used in the [ScriptEditor]. - Add a syntax highlighter to an individual script by calling [method ScriptEditorBase._add_syntax_highlighter]. To apply to all scripts on open, call [method ScriptEditor.register_syntax_highlighter] + Add a syntax highlighter to an individual script by calling ScriptEditorBase._add_syntax_highlighter (currently not working). To apply to all scripts on open, call [method ScriptEditor.register_syntax_highlighter] </description> <tutorials> </tutorials> <methods> - <method name="_get_name" qualifiers="virtual"> + <method name="_get_name" qualifiers="virtual const"> <return type="String" /> <description> Virtual method which can be overridden to return the syntax highlighter name. </description> </method> - <method name="_get_supported_extentions" qualifiers="virtual"> - <return type="Array" /> - <description> - Virtual method which can be overridden to return the supported file extensions. - </description> - </method> - <method name="_get_supported_languages" qualifiers="virtual"> + <method name="_get_supported_languages" qualifiers="virtual const"> <return type="Array" /> <description> Virtual method which can be overridden to return the supported language names. diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml index 47da8ec37b..94e96e985f 100644 --- a/doc/classes/EditorTranslationParserPlugin.xml +++ b/doc/classes/EditorTranslationParserPlugin.xml @@ -102,8 +102,8 @@ <tutorials> </tutorials> <methods> - <method name="_get_recognized_extensions" qualifiers="virtual"> - <return type="Array" /> + <method name="_get_recognized_extensions" qualifiers="virtual const"> + <return type="PackedStringArray" /> <description> Gets the list of file extensions to associate with this parser, e.g. [code]["csv"][/code]. </description> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 907cf8587d..a3759a51dd 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -10,6 +10,14 @@ <tutorials> </tutorials> <methods> + <method name="_get_connection_line" qualifiers="virtual"> + <return type="PackedVector2Array" /> + <argument index="0" name="from" type="Vector2" /> + <argument index="1" name="to" type="Vector2" /> + <description> + Virtual method which can be overridden to customize how connections are drawn. + </description> + </method> <method name="add_valid_connection_type"> <return type="void" /> <argument index="0" name="from_type" type="int" /> @@ -64,6 +72,14 @@ Removes the connection between the [code]from_port[/code] slot of the [code]from[/code] GraphNode and the [code]to_port[/code] slot of the [code]to[/code] GraphNode. If the connection does not exist, no connection is removed. </description> </method> + <method name="get_connection_line"> + <return type="PackedVector2Array" /> + <argument index="0" name="from" type="Vector2" /> + <argument index="1" name="to" type="Vector2" /> + <description> + Returns the points which would make up a connection between [code]from[/code] and [code]to[/code]. + </description> + </method> <method name="get_connection_list" qualifiers="const"> <return type="Array" /> <description> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 380e9314d4..cd2f4eca18 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -61,7 +61,7 @@ <member name="light_specular" type="float" setter="set_param" getter="get_param" default="0.5"> The intensity of the specular blob in objects affected by the light. At [code]0[/code], the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. </member> - <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.1"> + <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.2"> Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. </member> <member name="shadow_blur" type="float" setter="set_param" getter="get_param" default="1.0"> @@ -75,7 +75,7 @@ </member> <member name="shadow_fog_fade" type="float" setter="set_param" getter="get_param" default="0.1"> </member> - <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="2.0"> + <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="1.0"> Offsets the lookup into the shadow map by the object's normal. This can be used to reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible. </member> <member name="shadow_reverse_cull_face" type="bool" setter="set_shadow_reverse_cull_face" getter="get_shadow_reverse_cull_face" default="false"> diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml index b9f50ad02a..610b00efe9 100644 --- a/doc/classes/MultiplayerAPI.xml +++ b/doc/classes/MultiplayerAPI.xml @@ -66,34 +66,6 @@ Sends the given raw [code]bytes[/code] to a specific peer identified by [code]id[/code] (see [method MultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers. </description> </method> - <method name="send_despawn"> - <return type="int" enum="Error" /> - <argument index="0" name="peer_id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="path" type="NodePath" /> - <argument index="3" name="data" type="PackedByteArray" default="PackedByteArray()" /> - <description> - Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant SPAWN_MODE_SERVER] (see [method spawnable_config]) and the request is sent by the server (see [method is_network_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal network_despawn]. In all other cases no deletion happens, and the signal [signal network_despawn_request] is emitted instead. - </description> - </method> - <method name="send_spawn"> - <return type="int" enum="Error" /> - <argument index="0" name="peer_id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="path" type="NodePath" /> - <argument index="3" name="data" type="PackedByteArray" default="PackedByteArray()" /> - <description> - Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant SPAWN_MODE_SERVER] (see [method spawnable_config]) and the request is sent by the server (see [method is_network_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal network_spawn]. In all other cases no instantiation happens, and the signal [signal network_spawn_request] is emitted instead. - </description> - </method> - <method name="spawnable_config"> - <return type="int" enum="Error" /> - <argument index="0" name="scene_id" type="int" /> - <argument index="1" name="spawn_mode" type="int" enum="MultiplayerAPI.SpawnMode" /> - <description> - Configures the MultiplayerAPI to track instances of the [PackedScene] idenfied by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication. See [enum SpawnMode] for the possible configurations. - </description> - </method> </methods> <members> <member name="allow_object_decoding" type="bool" setter="set_allow_object_decoding" getter="is_object_decoding_allowed" default="false"> @@ -106,6 +78,8 @@ <member name="refuse_new_network_connections" type="bool" setter="set_refuse_new_network_connections" getter="is_refusing_new_network_connections" default="false"> If [code]true[/code], the MultiplayerAPI's [member network_peer] refuses new incoming connections. </member> + <member name="replicator" type="MultiplayerReplicator" setter="" getter="get_replicator"> + </member> <member name="root_node" type="Node" setter="set_root_node" getter="get_root_node"> The root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed. This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene. @@ -122,25 +96,6 @@ Emitted when this MultiplayerAPI's [member network_peer] fails to establish a connection to a server. Only emitted on clients. </description> </signal> - <signal name="network_despawn"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="node" type="Node" /> - <argument index="3" name="data" type="PackedByteArray" /> - <description> - Emitted on a client before deleting a local Node upon receiving a despawn request from the server. - </description> - </signal> - <signal name="network_despawn_request"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="parent" type="Node" /> - <argument index="3" name="name" type="String" /> - <argument index="4" name="data" type="PackedByteArray" /> - <description> - Emitted when a network despawn request has been received from a client, or for a [PackedScene] that has been configured as [constant SPAWN_MODE_CUSTOM]. - </description> - </signal> <signal name="network_peer_connected"> <argument index="0" name="id" type="int" /> <description> @@ -160,39 +115,6 @@ Emitted when this MultiplayerAPI's [member network_peer] receive a [code]packet[/code] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet. </description> </signal> - <signal name="network_spawn"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="node" type="Node" /> - <argument index="3" name="data" type="PackedByteArray" /> - <description> - Emitted on a client after a new Node is instantiated locally and added to the SceneTree upon receiving a spawn request from the server. - </description> - </signal> - <signal name="network_spawn_request"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="parent" type="Node" /> - <argument index="3" name="name" type="String" /> - <argument index="4" name="data" type="PackedByteArray" /> - <description> - Emitted when a network spawn request has been received from a client, or for a [PackedScene] that has been configured as [constant SPAWN_MODE_CUSTOM]. - </description> - </signal> - <signal name="network_spawnable_added"> - <argument index="0" name="scene_id" type="int" /> - <argument index="1" name="node" type="Node" /> - <description> - Emitted when an instance of a [PackedScene] that has been configured for networking enters the [SceneTree]. See [method spawnable_config]. - </description> - </signal> - <signal name="network_spawnable_removed"> - <argument index="0" name="scene_id" type="int" /> - <argument index="1" name="node" type="Node" /> - <description> - Emitted when an instance of a [PackedScene] that has been configured for networking leaves the [SceneTree]. See [method spawnable_config]. - </description> - </signal> <signal name="server_disconnected"> <description> Emitted when this MultiplayerAPI's [member network_peer] disconnects from server. Only emitted on clients. @@ -212,14 +134,5 @@ <constant name="RPC_MODE_PUPPET" value="3" enum="RPCMode"> Used with [method Node.rpc_config] to set a method to be called or a property to be changed only on puppets for this node. Analogous to the [code]puppet[/code] keyword. Only accepts calls or property changes from the node's network master, see [method Node.set_network_master]. </constant> - <constant name="SPAWN_MODE_NONE" value="0" enum="SpawnMode"> - Used with [method spawnable_config] to identify a [PackedScene] that should not be replicated. - </constant> - <constant name="SPAWN_MODE_SERVER" value="1" enum="SpawnMode"> - Used with [method spawnable_config] to identify a [PackedScene] that should be automatically replicated from server to clients. - </constant> - <constant name="SPAWN_MODE_CUSTOM" value="2" enum="SpawnMode"> - Used with [method spawnable_config] to identify a [PackedScene] that can be manually replicated among peers. - </constant> </constants> </class> diff --git a/doc/classes/MultiplayerReplicator.xml b/doc/classes/MultiplayerReplicator.xml new file mode 100644 index 0000000000..15029e181f --- /dev/null +++ b/doc/classes/MultiplayerReplicator.xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="MultiplayerReplicator" inherits="Object" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="decode_state"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <argument index="2" name="data" type="PackedByteArray" /> + <description> + Decode the given [code]data[/code] representing a spawnable state into [code]object[/code] using the configuration associated with the provided [code]scene_id[/code]. This function is called automatically when a client receives a server spawn for a scene with [constant REPLICATION_MODE_SERVER]. See [method spawn_config]. + Tip: You may find this function useful in servers when parsing spawn requests from clients, or when implementing your own logic with [constant REPLICATION_MODE_CUSTOM]. + </description> + </method> + <method name="despawn"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <argument index="2" name="peer_id" type="int" default="0" /> + <description> + </description> + </method> + <method name="encode_state"> + <return type="PackedByteArray" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <description> + Encode the given [code]object[/code] using the configuration associated with the provided [code]scene_id[/code]. This function is called automatically when the server spawns scenes with [constant REPLICATION_MODE_SERVER]. See [method spawn_config]. + Tip: You may find this function useful when requesting spawns from clients to server, or when implementing your own logic with [constant REPLICATION_MODE_CUSTOM]. + </description> + </method> + <method name="send_despawn"> + <return type="int" enum="Error" /> + <argument index="0" name="peer_id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="data" type="Variant" default="null" /> + <argument index="3" name="path" type="NodePath" default="NodePath("")" /> + <description> + Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_network_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal despawned]. In all other cases no deletion happens, and the signal [signal despawn_requested] is emitted instead. + </description> + </method> + <method name="send_spawn"> + <return type="int" enum="Error" /> + <argument index="0" name="peer_id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="data" type="Variant" default="null" /> + <argument index="3" name="path" type="NodePath" default="NodePath("")" /> + <description> + Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_network_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal spawned]. In all other cases no instantiation happens, and the signal [signal spawn_requested] is emitted instead. + </description> + </method> + <method name="spawn"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <argument index="2" name="peer_id" type="int" default="0" /> + <description> + </description> + </method> + <method name="spawn_config"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="spawn_mode" type="int" enum="MultiplayerReplicator.ReplicationMode" /> + <argument index="2" name="properties" type="StringName[]" default="[]" /> + <argument index="3" name="custom_send" type="Callable" /> + <argument index="4" name="custom_receive" type="Callable" /> + <description> + Configures the MultiplayerAPI to track instances of the [PackedScene] identified by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication. When [code]mode[/code] is [constant REPLICATION_MODE_SERVER], the specified [code]properties[/code] will also be replicated to clients during the initial spawn. + Tip: You can use a custom property in the scene main script to return a customly optimized state representation. + </description> + </method> + </methods> + <signals> + <signal name="despawn_requested"> + <argument index="0" name="id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="parent" type="Node" /> + <argument index="3" name="name" type="String" /> + <argument index="4" name="data" type="PackedByteArray" /> + <description> + Emitted when a network despawn request has been received from a client, or for a [PackedScene] that has been configured as [constant REPLICATION_MODE_CUSTOM]. + </description> + </signal> + <signal name="despawned"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted on a client before deleting a local Node upon receiving a despawn request from the server. + </description> + </signal> + <signal name="replicated_instance_added"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted when an instance of a [PackedScene] that has been configured for networking enters the [SceneTree]. See [method spawn_config]. + </description> + </signal> + <signal name="replicated_instance_removed"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted when an instance of a [PackedScene] that has been configured for networking leaves the [SceneTree]. See [method spawn_config]. + </description> + </signal> + <signal name="spawn_requested"> + <argument index="0" name="id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="parent" type="Node" /> + <argument index="3" name="name" type="String" /> + <argument index="4" name="data" type="PackedByteArray" /> + <description> + Emitted when a network spawn request has been received from a client, or for a [PackedScene] that has been configured as [constant REPLICATION_MODE_CUSTOM]. + </description> + </signal> + <signal name="spawned"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted on a client after a new Node is instantiated locally and added to the SceneTree upon receiving a spawn request from the server. + </description> + </signal> + </signals> + <constants> + <constant name="REPLICATION_MODE_NONE" value="0" enum="ReplicationMode"> + Used with [method spawn_config] to identify a [PackedScene] that should not be replicated. + </constant> + <constant name="REPLICATION_MODE_SERVER" value="1" enum="ReplicationMode"> + Used with [method spawn_config] to identify a [PackedScene] that should be automatically replicated from server to clients. + </constant> + <constant name="REPLICATION_MODE_CUSTOM" value="2" enum="ReplicationMode"> + Used with [method spawn_config] to identify a [PackedScene] that can be manually replicated among peers. + </constant> + </constants> +</class> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 096fbbf2c0..97e6c71ef9 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -35,6 +35,14 @@ 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]. </description> </method> + <method name="_get_configuration_warnings" qualifiers="virtual const"> + <return type="PackedStringArray" /> + <description> + The elements in the array returned from this method are displayed as warnings in the Scene Dock if the script that overrides it is a [code]tool[/code] script. + Returning an empty array produces no warnings. + Call [method update_configuration_warnings] when the warnings need to be updated for this node. + </description> + </method> <method name="_get_configuration_warnings" qualifiers="virtual"> <return type="String[]" /> <description> diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index 701ecf815c..65dedf5280 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -12,12 +12,6 @@ <link title="When and how to avoid using nodes for everything">https://docs.godotengine.org/en/latest/getting_started/workflow/best_practices/node_alternatives.html</link> </tutorials> <methods> - <method name="_setup_local_to_scene" qualifiers="virtual"> - <return type="void" /> - <description> - Virtual function which can be overridden to customize the behavior value of [method setup_local_to_scene]. - </description> - </method> <method name="duplicate" qualifiers="const"> <return type="Resource" /> <argument index="0" name="subresources" type="bool" default="false" /> @@ -54,7 +48,7 @@ <method name="setup_local_to_scene"> <return type="void" /> <description> - This method is called when a resource with [member resource_local_to_scene] enabled is loaded from a [PackedScene] instantiation. Its behavior can be customized by overriding [method _setup_local_to_scene] from script. + This method is called when a resource with [member resource_local_to_scene] enabled is loaded from a [PackedScene] instantiation. Its behavior can be customized by connecting [signal setup_local_to_scene_requested] from script. For most resources, this method performs no base logic. [ViewportTexture] performs custom logic to properly set the proxy texture and flags in the local viewport. </description> </method> @@ -84,6 +78,10 @@ [b]Note:[/b] This signal is not emitted automatically for custom resources, which means that you need to create a setter and emit the signal yourself. </description> </signal> + <signal name="setup_local_to_scene_requested"> + <description> + </description> + </signal> </signals> <constants> </constants> diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml index bce5785cc1..0c2bb26c02 100644 --- a/doc/classes/ResourceFormatLoader.xml +++ b/doc/classes/ResourceFormatLoader.xml @@ -11,22 +11,28 @@ <tutorials> </tutorials> <methods> - <method name="_get_dependencies" qualifiers="virtual"> - <return type="void" /> + <method name="_exists" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="path" type="String" /> + <description> + </description> + </method> + <method name="_get_dependencies" qualifiers="virtual const"> + <return type="PackedStringArray" /> <argument index="0" name="path" type="String" /> - <argument index="1" name="add_types" type="String" /> + <argument index="1" name="add_types" type="bool" /> <description> If implemented, gets the dependencies of a given resource. If [code]add_types[/code] is [code]true[/code], paths should be appended [code]::TypeName[/code], where [code]TypeName[/code] is the class name of the dependency. [b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return [code]"Resource"[/code] for them. </description> </method> - <method name="_get_recognized_extensions" qualifiers="virtual"> + <method name="_get_recognized_extensions" qualifiers="virtual const"> <return type="PackedStringArray" /> <description> Gets the list of extensions for files this loader is able to read. </description> </method> - <method name="_get_resource_type" qualifiers="virtual"> + <method name="_get_resource_type" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="path" type="String" /> <description> @@ -34,15 +40,21 @@ [b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return [code]"Resource"[/code] for them. </description> </method> - <method name="_handles_type" qualifiers="virtual"> + <method name="_get_resource_uid" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="path" type="String" /> + <description> + </description> + </method> + <method name="_handles_type" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="typename" type="StringName" /> + <argument index="0" name="type" type="StringName" /> <description> Tells which resource class this loader can load. [b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just handle [code]"Resource"[/code] for them. </description> </method> - <method name="_load" qualifiers="virtual"> + <method name="_load" qualifiers="virtual const"> <return type="Variant" /> <argument index="0" name="path" type="String" /> <argument index="1" name="original_path" type="String" /> @@ -53,10 +65,10 @@ The [code]cache_mode[/code] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. </description> </method> - <method name="_rename_dependencies" qualifiers="virtual"> + <method name="_rename_dependencies" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="path" type="String" /> - <argument index="1" name="renames" type="String" /> + <argument index="1" name="renames" type="Dictionary" /> <description> If implemented, renames dependencies within the given resource and saves it. [code]renames[/code] is a dictionary [code]{ String => String }[/code] mapping old dependency paths to new paths. Returns [constant OK] on success, or an [enum Error] constant in case of failure. diff --git a/doc/classes/ResourceFormatSaver.xml b/doc/classes/ResourceFormatSaver.xml index ef9eebc953..7ee8875321 100644 --- a/doc/classes/ResourceFormatSaver.xml +++ b/doc/classes/ResourceFormatSaver.xml @@ -10,14 +10,14 @@ <tutorials> </tutorials> <methods> - <method name="_get_recognized_extensions" qualifiers="virtual"> + <method name="_get_recognized_extensions" qualifiers="virtual const"> <return type="PackedStringArray" /> <argument index="0" name="resource" type="Resource" /> <description> Returns the list of extensions available for saving the resource object, provided it is recognized (see [method _recognize]). </description> </method> - <method name="_recognize" qualifiers="virtual"> + <method name="_recognize" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="resource" type="Resource" /> <description> diff --git a/doc/classes/RichTextEffect.xml b/doc/classes/RichTextEffect.xml index 142afbb860..fd93f6be56 100644 --- a/doc/classes/RichTextEffect.xml +++ b/doc/classes/RichTextEffect.xml @@ -23,7 +23,7 @@ <link title="RichTextEffect test project (third-party)">https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link> </tutorials> <methods> - <method name="_process_custom_fx" qualifiers="virtual"> + <method name="_process_custom_fx" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="char_fx" type="CharFXTransform" /> <description> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 7bbcc5e0b5..e77232a613 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -555,7 +555,7 @@ <theme_item name="italics_font_size" data_type="font_size" type="int"> The font size used for italics text. </theme_item> - <theme_item name="line_separation" data_type="constant" type="int" default="1"> + <theme_item name="line_separation" data_type="constant" type="int" default="0"> The vertical space between lines. </theme_item> <theme_item name="mono_font" data_type="font" type="Font"> diff --git a/doc/classes/ScriptEditorBase.xml b/doc/classes/ScriptEditorBase.xml index 0efcde5638..08baa705e8 100644 --- a/doc/classes/ScriptEditorBase.xml +++ b/doc/classes/ScriptEditorBase.xml @@ -9,13 +9,6 @@ <tutorials> </tutorials> <methods> - <method name="_add_syntax_highlighter" qualifiers="virtual"> - <return type="void" /> - <argument index="0" name="highlighter" type="Object" /> - <description> - Adds a [EditorSyntaxHighlighter] to the open script. - </description> - </method> <method name="get_base_editor" qualifiers="const"> <return type="Control" /> <description> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 467e2f901f..97efc24bd1 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -181,7 +181,17 @@ <method name="get_extension" qualifiers="const"> <return type="String" /> <description> - If the string is a valid file path, returns the extension. + Returns the extension without the leading period character ([code].[/code]) if the string is a valid file name or path. If the string does not contain an extension, returns an empty string instead. + [codeblock] + print("/path/to/file.txt".get_extension()) # "txt" + print("file.txt".get_extension()) # "txt" + print("file.sample.txt".get_extension()) # "txt" + print(".txt".get_extension()) # "txt" + print("file.txt.".get_extension()) # "" (empty string) + print("file.txt..".get_extension()) # "" (empty string) + print("txt".get_extension()) # "" (empty string) + print("".get_extension()) # "" (empty string) + [/codeblock] </description> </method> <method name="get_file" qualifiers="const"> diff --git a/doc/classes/SyntaxHighlighter.xml b/doc/classes/SyntaxHighlighter.xml index ea0d1c27a3..c478cb0eb6 100644 --- a/doc/classes/SyntaxHighlighter.xml +++ b/doc/classes/SyntaxHighlighter.xml @@ -17,7 +17,7 @@ Virtual method which can be overridden to clear any local caches. </description> </method> - <method name="_get_line_syntax_highlighting" qualifiers="virtual"> + <method name="_get_line_syntax_highlighting" qualifiers="virtual const"> <return type="Dictionary" /> <argument index="0" name="line" type="int" /> <description> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 7aa627b7d0..abb4119584 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -30,7 +30,7 @@ </method> <method name="_handle_unicode_input" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="unicode" type="int" /> + <argument index="0" name="unicode_char" type="int" /> <description> Override this method to define what happens when the types in the provided key [code]unicode[/code]. </description> diff --git a/doc/classes/TextFile.xml b/doc/classes/TextFile.xml deleted file mode 100644 index 1c2c2ff25c..0000000000 --- a/doc/classes/TextFile.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="TextFile" inherits="Resource" version="4.0"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </tutorials> - <methods> - </methods> - <constants> - </constants> -</class> diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml index f6dbd2ad43..3a489419c1 100644 --- a/doc/classes/VisualShaderNodeCustom.xml +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -16,17 +16,17 @@ <link title="Visual Shader plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/visual_shader_plugins.html</link> </tutorials> <methods> - <method name="_get_category" qualifiers="virtual"> + <method name="_get_category" qualifiers="virtual const"> <return type="String" /> <description> Override this method to define the path to the associated custom node in the Visual Shader Editor's members dialog. The path may look like [code]"MyGame/MyFunctions/Noise"[/code]. Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the "Addons" category. </description> </method> - <method name="_get_code" qualifiers="virtual"> + <method name="_get_code" qualifiers="virtual const"> <return type="String" /> - <argument index="0" name="input_vars" type="Array" /> - <argument index="1" name="output_vars" type="Array" /> + <argument index="0" name="input_vars" type="PackedStringArray" /> + <argument index="1" name="output_vars" type="String[]" /> <argument index="2" name="mode" type="int" /> <argument index="3" name="type" type="int" /> <description> @@ -37,14 +37,14 @@ Defining this method is [b]required[/b]. </description> </method> - <method name="_get_description" qualifiers="virtual"> + <method name="_get_description" qualifiers="virtual const"> <return type="String" /> <description> Override this method to define the description of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is [b]optional[/b]. </description> </method> - <method name="_get_global_code" qualifiers="virtual"> + <method name="_get_global_code" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="mode" type="int" /> <description> @@ -54,22 +54,22 @@ Defining this method is [b]optional[/b]. </description> </method> - <method name="_get_input_port_count" qualifiers="virtual"> + <method name="_get_input_port_count" qualifiers="virtual const"> <return type="int" /> <description> Override this method to define the amount of input ports of the associated custom node. Defining this method is [b]required[/b]. If not overridden, the node has no input ports. </description> </method> - <method name="_get_input_port_name" qualifiers="virtual"> - <return type="StringName" /> + <method name="_get_input_port_name" qualifiers="virtual const"> + <return type="String" /> <argument index="0" name="port" type="int" /> <description> Override this method to define the names of input ports of the associated custom node. The names are used both for the input slots in the editor and as identifiers in the shader code, and are passed in the [code]input_vars[/code] array in [method _get_code]. Defining this method is [b]optional[/b], but recommended. If not overridden, input ports are named as [code]"in" + str(port)[/code]. </description> </method> - <method name="_get_input_port_type" qualifiers="virtual"> + <method name="_get_input_port_type" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="port" type="int" /> <description> @@ -77,29 +77,29 @@ Defining this method is [b]optional[/b], but recommended. If not overridden, input ports will return the [constant VisualShaderNode.PORT_TYPE_SCALAR] type. </description> </method> - <method name="_get_name" qualifiers="virtual"> + <method name="_get_name" qualifiers="virtual const"> <return type="String" /> <description> Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph. Defining this method is [b]optional[/b], but recommended. If not overridden, the node will be named as "Unnamed". </description> </method> - <method name="_get_output_port_count" qualifiers="virtual"> + <method name="_get_output_port_count" qualifiers="virtual const"> <return type="int" /> <description> Override this method to define the amount of output ports of the associated custom node. Defining this method is [b]required[/b]. If not overridden, the node has no output ports. </description> </method> - <method name="_get_output_port_name" qualifiers="virtual"> - <return type="StringName" /> + <method name="_get_output_port_name" qualifiers="virtual const"> + <return type="String" /> <argument index="0" name="port" type="int" /> <description> Override this method to define the names of output ports of the associated custom node. The names are used both for the output slots in the editor and as identifiers in the shader code, and are passed in the [code]output_vars[/code] array in [method _get_code]. Defining this method is [b]optional[/b], but recommended. If not overridden, output ports are named as [code]"out" + str(port)[/code]. </description> </method> - <method name="_get_output_port_type" qualifiers="virtual"> + <method name="_get_output_port_type" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="port" type="int" /> <description> @@ -107,14 +107,14 @@ Defining this method is [b]optional[/b], but recommended. If not overridden, output ports will return the [constant VisualShaderNode.PORT_TYPE_SCALAR] type. </description> </method> - <method name="_get_return_icon_type" qualifiers="virtual"> + <method name="_get_return_icon_type" qualifiers="virtual const"> <return type="int" /> <description> Override this method to define the return icon of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is [b]optional[/b]. If not overridden, no return icon is shown. </description> </method> - <method name="_is_highend" qualifiers="virtual"> + <method name="_is_highend" qualifiers="virtual const"> <return type="bool" /> <description> Override this method to enable high-end mark in the Visual Shader Editor's members dialog. diff --git a/doc/classes/float.xml b/doc/classes/float.xml index 60878eb0bd..4bf04fe25f 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -4,9 +4,13 @@ Float built-in type. </brief_description> <description> - Float built-in type. + The [float] built-in type is a 64-bit double-precision floating-point number, equivalent to [code]double[/code] in C++. This type has 14 reliable decimal digits of precision. The [float] type can be stored in [Variant], which is the generic type used by the engine. The maximum value of [float] is approximately [code]1.79769e308[/code], and the minimum is approximately [code]-1.79769e308[/code]. + Many methods and properties in the engine use 32-bit single-precision floating-point numbers instead, equivalent to [code]float[/code] in C++, which have 6 reliable decimal digits of precision. For data structures such as [Vector2] and [Vector3], Godot uses 32-bit floating-point numbers by default, but it can be changed to use 64-bit doubles if Godot is compiled with the [code]float=64[/code] option. + Math done using the [float] type is not guaranteed to be exact or deterministic, and will often result in small errors. You should usually use the [method @GlobalScope.is_equal_approx] and [method @GlobalScope.is_zero_approx] methods instead of [code]==[/code] to compare [float] values for equality. </description> <tutorials> + <link title="Wikipedia: Double-precision floating-point format">https://en.wikipedia.org/wiki/Double-precision_floating-point_format</link> + <link title="Wikipedia: Single-precision floating-point format">https://en.wikipedia.org/wiki/Single-precision_floating-point_format</link> </tutorials> <methods> <method name="float" qualifiers="constructor"> @@ -231,11 +235,13 @@ <method name="operator unary+" qualifiers="operator"> <return type="float" /> <description> + Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable. </description> </method> <method name="operator unary-" qualifiers="operator"> <return type="float" /> <description> + Returns the negative value of the [float]. If positive, turns the number negative. If negative, turns the number positive. With floats, the number zero can be either positive or negative. </description> </method> </methods> diff --git a/doc/classes/int.xml b/doc/classes/int.xml index 84a01aa0d0..32b5fe1012 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -327,11 +327,13 @@ <method name="operator unary+" qualifiers="operator"> <return type="int" /> <description> + Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable. </description> </method> <method name="operator unary-" qualifiers="operator"> <return type="int" /> <description> + Returns the negated value of the [int]. If positive, turns the number negative. If negative, turns the number positive. If zero, does nothing. </description> </method> <method name="operator |" qualifiers="operator"> |