diff options
Diffstat (limited to 'doc')
37 files changed, 647 insertions, 337 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 3ca7e0716b..d57d241b53 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1280,6 +1280,10 @@ <constant name="HORIZONTAL" value="0" enum="Orientation"> General horizontal alignment, usually used for [Separator], [ScrollBar], [Slider], etc. </constant> + <constant name="CLOCKWISE" value="0" enum="ClockDirection"> + </constant> + <constant name="COUNTERCLOCKWISE" value="1" enum="ClockDirection"> + </constant> <constant name="HALIGN_LEFT" value="0" enum="HAlign"> Horizontal left alignment, usually for text-derived classes. </constant> @@ -2405,43 +2409,49 @@ <constant name="PROPERTY_HINT_LAYERS_2D_PHYSICS" value="9" enum="PropertyHint"> Hints that an integer property is a bitmask using the optionally named 2D physics layers. </constant> - <constant name="PROPERTY_HINT_LAYERS_3D_RENDER" value="10" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LAYERS_2D_NAVIGATION" value="10" enum="PropertyHint"> + Hints that an integer property is a bitmask using the optionally named 2D navigation layers. + </constant> + <constant name="PROPERTY_HINT_LAYERS_3D_RENDER" value="11" enum="PropertyHint"> Hints that an integer property is a bitmask using the optionally named 3D render layers. </constant> - <constant name="PROPERTY_HINT_LAYERS_3D_PHYSICS" value="11" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LAYERS_3D_PHYSICS" value="12" enum="PropertyHint"> Hints that an integer property is a bitmask using the optionally named 3D physics layers. </constant> - <constant name="PROPERTY_HINT_FILE" value="12" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LAYERS_3D_NAVIGATION" value="13" enum="PropertyHint"> + Hints that an integer property is a bitmask using the optionally named 2D navigation layers. + </constant> + <constant name="PROPERTY_HINT_FILE" value="14" enum="PropertyHint"> Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. </constant> - <constant name="PROPERTY_HINT_DIR" value="13" enum="PropertyHint"> + <constant name="PROPERTY_HINT_DIR" value="15" enum="PropertyHint"> Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. </constant> - <constant name="PROPERTY_HINT_GLOBAL_FILE" value="14" enum="PropertyHint"> + <constant name="PROPERTY_HINT_GLOBAL_FILE" value="16" enum="PropertyHint"> Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. </constant> - <constant name="PROPERTY_HINT_GLOBAL_DIR" value="15" enum="PropertyHint"> + <constant name="PROPERTY_HINT_GLOBAL_DIR" value="17" enum="PropertyHint"> Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. </constant> - <constant name="PROPERTY_HINT_RESOURCE_TYPE" value="16" enum="PropertyHint"> + <constant name="PROPERTY_HINT_RESOURCE_TYPE" value="18" enum="PropertyHint"> Hints that a property is an instance of a [Resource]-derived type, optionally specified via the hint string (e.g. [code]"Texture2D"[/code]). Editing it will show a popup menu of valid resource types to instantiate. </constant> - <constant name="PROPERTY_HINT_MULTILINE_TEXT" value="17" enum="PropertyHint"> + <constant name="PROPERTY_HINT_MULTILINE_TEXT" value="19" enum="PropertyHint"> Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. </constant> - <constant name="PROPERTY_HINT_PLACEHOLDER_TEXT" value="18" enum="PropertyHint"> + <constant name="PROPERTY_HINT_PLACEHOLDER_TEXT" value="20" enum="PropertyHint"> Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use. </constant> - <constant name="PROPERTY_HINT_COLOR_NO_ALPHA" value="19" enum="PropertyHint"> + <constant name="PROPERTY_HINT_COLOR_NO_ALPHA" value="21" enum="PropertyHint"> Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited. </constant> - <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSY" value="20" enum="PropertyHint"> + <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSY" value="22" enum="PropertyHint"> Hints that an image is compressed using lossy compression. </constant> - <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS" value="21" enum="PropertyHint"> + <constant name="PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS" value="23" enum="PropertyHint"> Hints that an image is compressed using lossless compression. </constant> - <constant name="PROPERTY_HINT_TYPE_STRING" value="23" enum="PropertyHint"> + <constant name="PROPERTY_HINT_TYPE_STRING" value="25" enum="PropertyHint"> Hint that a property represents a particular type. If a property is [constant TYPE_STRING], allows to set a type from the create dialog. If you need to create an [Array] to contain elements of a specific type, the [code]hint_string[/code] must encode nested types using [code]":"[/code] and [code]"/"[/code] for specifying [Resource] types. For instance: [codeblock] hint_string = "%s:" % [TYPE_INT] # Array of inteters. diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index 31e6ea5e54..fa0c3b167a 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -93,7 +93,7 @@ <member name="alpha_scissor_threshold" type="float" setter="set_alpha_scissor_threshold" getter="get_alpha_scissor_threshold"> Threshold at which the alpha scissor will discard values. </member> - <member name="anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy"> + <member name="anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy" default="0.0"> The strength of the anisotropy effect. </member> <member name="anisotropy_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> @@ -105,19 +105,19 @@ <member name="ao_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], ambient occlusion is enabled. Ambient occlusion darkens areas based on the [member ao_texture]. </member> - <member name="ao_light_affect" type="float" setter="set_ao_light_affect" getter="get_ao_light_affect"> + <member name="ao_light_affect" type="float" setter="set_ao_light_affect" getter="get_ao_light_affect" default="0.0"> Amount that ambient occlusion affects lighting from lights. If [code]0[/code], ambient occlusion only affects ambient light. If [code]1[/code], ambient occlusion affects lights just as much as it affects ambient light. This can be used to impact the strength of the ambient occlusion effect, but typically looks unrealistic. </member> - <member name="ao_on_uv2" type="bool" setter="set_flag" getter="get_flag"> + <member name="ao_on_uv2" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], use [code]UV2[/code] coordinates to look up from the [member ao_texture]. </member> <member name="ao_texture" type="Texture2D" setter="set_texture" getter="get_texture"> Texture that defines the amount of ambient occlusion for a given point on the object. </member> - <member name="ao_texture_channel" type="int" setter="set_ao_texture_channel" getter="get_ao_texture_channel" enum="BaseMaterial3D.TextureChannel"> + <member name="ao_texture_channel" type="int" setter="set_ao_texture_channel" getter="get_ao_texture_channel" enum="BaseMaterial3D.TextureChannel" default="0"> Specifies the channel of the [member ao_texture] in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. </member> - <member name="backlight" type="Color" setter="set_backlight" getter="get_backlight"> + <member name="backlight" type="Color" setter="set_backlight" getter="get_backlight" default="Color( 0, 0, 0, 1 )"> The color used by the backlight effect. Represents the light passing through an object. </member> <member name="backlight_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> @@ -137,13 +137,13 @@ The material's blend mode. [b]Note:[/b] Values other than [code]Mix[/code] force the object into the transparent pipeline. See [enum BlendMode]. </member> - <member name="clearcoat" type="float" setter="set_clearcoat" getter="get_clearcoat"> + <member name="clearcoat" type="float" setter="set_clearcoat" getter="get_clearcoat" default="1.0"> Sets the strength of the clearcoat effect. Setting to [code]0[/code] looks the same as disabling the clearcoat effect. </member> <member name="clearcoat_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough. </member> - <member name="clearcoat_gloss" type="float" setter="set_clearcoat_gloss" getter="get_clearcoat_gloss"> + <member name="clearcoat_gloss" type="float" setter="set_clearcoat_gloss" getter="get_clearcoat_gloss" default="0.5"> Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat. </member> <member name="clearcoat_texture" type="Texture2D" setter="set_texture" getter="get_texture"> @@ -158,7 +158,7 @@ <member name="detail_albedo" type="Texture2D" setter="set_texture" getter="get_texture"> Texture that specifies the color of the detail overlay. </member> - <member name="detail_blend_mode" type="int" setter="set_detail_blend_mode" getter="get_detail_blend_mode" enum="BaseMaterial3D.BlendMode"> + <member name="detail_blend_mode" type="int" setter="set_detail_blend_mode" getter="get_detail_blend_mode" enum="BaseMaterial3D.BlendMode" default="0"> Specifies how the [member detail_albedo] should blend with the current [code]ALBEDO[/code]. See [enum BlendMode] for options. </member> <member name="detail_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> @@ -171,7 +171,7 @@ Texture that specifies the per-pixel normal of the detail overlay. [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. </member> - <member name="detail_uv_layer" type="int" setter="set_detail_uv" getter="get_detail_uv" enum="BaseMaterial3D.DetailUV"> + <member name="detail_uv_layer" type="int" setter="set_detail_uv" getter="get_detail_uv" enum="BaseMaterial3D.DetailUV" default="0"> Specifies whether to use [code]UV[/code] or [code]UV2[/code] for the detail layer. See [enum DetailUV] for options. </member> <member name="diffuse_mode" type="int" setter="set_diffuse_mode" getter="get_diffuse_mode" enum="BaseMaterial3D.DiffuseMode" default="0"> @@ -183,30 +183,30 @@ <member name="disable_receive_shadows" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], the object receives no shadow that would otherwise be cast onto it. </member> - <member name="distance_fade_max_distance" type="float" setter="set_distance_fade_max_distance" getter="get_distance_fade_max_distance"> + <member name="distance_fade_max_distance" type="float" setter="set_distance_fade_max_distance" getter="get_distance_fade_max_distance" default="10.0"> Distance at which the object appears fully opaque. [b]Note:[/b] If [code]distance_fade_max_distance[/code] is less than [code]distance_fade_min_distance[/code], the behavior will be reversed. The object will start to fade away at [code]distance_fade_max_distance[/code] and will fully disappear once it reaches [code]distance_fade_min_distance[/code]. </member> - <member name="distance_fade_min_distance" type="float" setter="set_distance_fade_min_distance" getter="get_distance_fade_min_distance"> + <member name="distance_fade_min_distance" type="float" setter="set_distance_fade_min_distance" getter="get_distance_fade_min_distance" default="0.0"> Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible. [b]Note:[/b] If [code]distance_fade_min_distance[/code] is greater than [code]distance_fade_max_distance[/code], the behavior will be reversed. The object will start to fade away at [code]distance_fade_max_distance[/code] and will fully disappear once it reaches [code]distance_fade_min_distance[/code]. </member> <member name="distance_fade_mode" type="int" setter="set_distance_fade" getter="get_distance_fade" enum="BaseMaterial3D.DistanceFadeMode" default="0"> Specifies which type of fade to use. Can be any of the [enum DistanceFadeMode]s. </member> - <member name="emission" type="Color" setter="set_emission" getter="get_emission"> + <member name="emission" type="Color" setter="set_emission" getter="get_emission" default="Color( 0, 0, 0, 1 )"> The emitted light's color. See [member emission_enabled]. </member> <member name="emission_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if a [GIProbe] is used and this object is used in baked lighting. </member> - <member name="emission_energy" type="float" setter="set_emission_energy" getter="get_emission_energy"> + <member name="emission_energy" type="float" setter="set_emission_energy" getter="get_emission_energy" default="1.0"> The emitted light's strength. See [member emission_enabled]. </member> - <member name="emission_on_uv2" type="bool" setter="set_flag" getter="get_flag"> + <member name="emission_on_uv2" type="bool" setter="set_flag" getter="get_flag" default="false"> Use [code]UV2[/code] to read from the [member emission_texture]. </member> - <member name="emission_operator" type="int" setter="set_emission_operator" getter="get_emission_operator" enum="BaseMaterial3D.EmissionOperator"> + <member name="emission_operator" type="int" setter="set_emission_operator" getter="get_emission_operator" enum="BaseMaterial3D.EmissionOperator" default="0"> Sets how [member emission] interacts with [member emission_texture]. Can either add or multiply. See [enum EmissionOperator] for options. </member> <member name="emission_texture" type="Texture2D" setter="set_texture" getter="get_texture"> @@ -221,21 +221,23 @@ <member name="grow_amount" type="float" setter="set_grow" getter="get_grow" default="0.0"> Grows object vertices in the direction of their normals. </member> - <member name="heightmap_deep_parallax" type="bool" setter="set_heightmap_deep_parallax" getter="is_heightmap_deep_parallax_enabled"> + <member name="heightmap_deep_parallax" type="bool" setter="set_heightmap_deep_parallax" getter="is_heightmap_deep_parallax_enabled" default="false"> </member> <member name="heightmap_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> + If [code]true[/code], height mapping is enabled (also called "parallax mapping" or "depth mapping"). See also [member normal_enabled]. + [b]Note:[/b] Height mapping is not supported if triplanar mapping is used on the same material. The value of [member heightmap_enabled] will be ignored if [member uv1_triplanar] is enabled. </member> - <member name="heightmap_flip_binormal" type="bool" setter="set_heightmap_deep_parallax_flip_binormal" getter="get_heightmap_deep_parallax_flip_binormal"> + <member name="heightmap_flip_binormal" type="bool" setter="set_heightmap_deep_parallax_flip_binormal" getter="get_heightmap_deep_parallax_flip_binormal" default="false"> </member> - <member name="heightmap_flip_tangent" type="bool" setter="set_heightmap_deep_parallax_flip_tangent" getter="get_heightmap_deep_parallax_flip_tangent"> + <member name="heightmap_flip_tangent" type="bool" setter="set_heightmap_deep_parallax_flip_tangent" getter="get_heightmap_deep_parallax_flip_tangent" default="false"> </member> - <member name="heightmap_flip_texture" type="bool" setter="set_flag" getter="get_flag"> + <member name="heightmap_flip_texture" type="bool" setter="set_flag" getter="get_flag" default="false"> </member> <member name="heightmap_max_layers" type="int" setter="set_heightmap_deep_parallax_max_layers" getter="get_heightmap_deep_parallax_max_layers"> </member> <member name="heightmap_min_layers" type="int" setter="set_heightmap_deep_parallax_min_layers" getter="get_heightmap_deep_parallax_min_layers"> </member> - <member name="heightmap_scale" type="float" setter="set_heightmap_scale" getter="get_heightmap_scale"> + <member name="heightmap_scale" type="float" setter="set_heightmap_scale" getter="get_heightmap_scale" default="0.05"> </member> <member name="heightmap_texture" type="Texture2D" setter="set_texture" getter="get_texture"> </member> @@ -258,7 +260,7 @@ <member name="normal_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], normal mapping is enabled. </member> - <member name="normal_scale" type="float" setter="set_normal_scale" getter="get_normal_scale"> + <member name="normal_scale" type="float" setter="set_normal_scale" getter="get_normal_scale" default="1.0"> The strength of the normal map's effect. </member> <member name="normal_texture" type="Texture2D" setter="set_texture" getter="get_texture"> @@ -279,7 +281,7 @@ <member name="point_size" type="float" setter="set_point_size" getter="get_point_size" default="1.0"> The point size in pixels. See [member use_point_size]. </member> - <member name="proximity_fade_distance" type="float" setter="set_proximity_fade_distance" getter="get_proximity_fade_distance"> + <member name="proximity_fade_distance" type="float" setter="set_proximity_fade_distance" getter="get_proximity_fade_distance" default="1.0"> Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade. </member> <member name="proximity_fade_enable" type="bool" setter="set_proximity_fade" getter="is_proximity_fade_enabled" default="false"> @@ -288,16 +290,16 @@ <member name="refraction_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], the refraction effect is enabled. Distorts transparency based on light from behind the object. </member> - <member name="refraction_scale" type="float" setter="set_refraction" getter="get_refraction"> + <member name="refraction_scale" type="float" setter="set_refraction" getter="get_refraction" default="0.05"> The strength of the refraction effect. </member> <member name="refraction_texture" type="Texture2D" setter="set_texture" getter="get_texture"> Texture that controls the strength of the refraction per-pixel. Multiplied by [member refraction_scale]. </member> - <member name="refraction_texture_channel" type="int" setter="set_refraction_texture_channel" getter="get_refraction_texture_channel" enum="BaseMaterial3D.TextureChannel"> + <member name="refraction_texture_channel" type="int" setter="set_refraction_texture_channel" getter="get_refraction_texture_channel" enum="BaseMaterial3D.TextureChannel" default="0"> Specifies the channel of the [member ao_texture] in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. </member> - <member name="rim" type="float" setter="set_rim" getter="get_rim"> + <member name="rim" type="float" setter="set_rim" getter="get_rim" default="1.0"> Sets the strength of the rim lighting effect. </member> <member name="rim_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> @@ -306,7 +308,7 @@ <member name="rim_texture" type="Texture2D" setter="set_texture" getter="get_texture"> Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by [member rim]. </member> - <member name="rim_tint" type="float" setter="set_rim_tint" getter="get_rim_tint"> + <member name="rim_tint" type="float" setter="set_rim_tint" getter="get_rim_tint" default="0.5"> The amount of to blend light and albedo color when rendering rim effect. If [code]0[/code] the light color is used, while [code]1[/code] means albedo color is used. An intermediate value generally works best. </member> <member name="roughness" type="float" setter="set_roughness" getter="get_roughness" default="1.0"> @@ -330,24 +332,24 @@ <member name="subsurf_scatter_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> If [code]true[/code], subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. </member> - <member name="subsurf_scatter_skin_mode" type="bool" setter="set_flag" getter="get_flag"> + <member name="subsurf_scatter_skin_mode" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], subsurface scattering will use a special mode optimized for the color and density of human skin. </member> - <member name="subsurf_scatter_strength" type="float" setter="set_subsurface_scattering_strength" getter="get_subsurface_scattering_strength"> + <member name="subsurf_scatter_strength" type="float" setter="set_subsurface_scattering_strength" getter="get_subsurface_scattering_strength" default="0.0"> The strength of the subsurface scattering effect. </member> <member name="subsurf_scatter_texture" type="Texture2D" setter="set_texture" getter="get_texture"> Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by [member subsurf_scatter_strength]. </member> - <member name="subsurf_scatter_transmittance_boost" type="float" setter="set_transmittance_boost" getter="get_transmittance_boost"> + <member name="subsurf_scatter_transmittance_boost" type="float" setter="set_transmittance_boost" getter="get_transmittance_boost" default="0.0"> </member> - <member name="subsurf_scatter_transmittance_color" type="Color" setter="set_transmittance_color" getter="get_transmittance_color"> + <member name="subsurf_scatter_transmittance_color" type="Color" setter="set_transmittance_color" getter="get_transmittance_color" default="Color( 1, 1, 1, 1 )"> </member> - <member name="subsurf_scatter_transmittance_curve" type="float" setter="set_transmittance_curve" getter="get_transmittance_curve"> + <member name="subsurf_scatter_transmittance_curve" type="float" setter="set_transmittance_curve" getter="get_transmittance_curve" default="1.0"> </member> - <member name="subsurf_scatter_transmittance_depth" type="float" setter="set_transmittance_depth" getter="get_transmittance_depth"> + <member name="subsurf_scatter_transmittance_depth" type="float" setter="set_transmittance_depth" getter="get_transmittance_depth" default="0.1"> </member> - <member name="subsurf_scatter_transmittance_enabled" type="bool" setter="set_feature" getter="get_feature"> + <member name="subsurf_scatter_transmittance_enabled" type="bool" setter="set_feature" getter="get_feature" default="false"> </member> <member name="subsurf_scatter_transmittance_texture" type="Texture2D" setter="set_texture" getter="get_texture"> </member> diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index aea3542867..2fc4313e47 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -91,6 +91,9 @@ <theme_item name="add_preset" type="Texture2D"> The icon for the "Add Preset" button. </theme_item> + <theme_item name="bar_arrow" type="Texture2D"> + The texture for the arrow grabber. + </theme_item> <theme_item name="color_hue" type="Texture2D"> Custom texture for the hue selection slider on the right. </theme_item> diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml index 322cff4e43..1e9d089962 100644 --- a/doc/classes/EditorNode3DGizmoPlugin.xml +++ b/doc/classes/EditorNode3DGizmoPlugin.xml @@ -98,6 +98,13 @@ Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_mesh] and [method EditorNode3DGizmo.add_lines]. Should not be overridden. </description> </method> + <method name="get_gizmo_name" qualifiers="virtual"> + <return type="String"> + </return> + <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"> <return type="String"> </return> @@ -131,13 +138,6 @@ Gets material from the internal list of materials. If an [EditorNode3DGizmo] is provided, it will try to get the corresponding variant (selected and/or editable). </description> </method> - <method name="get_name" qualifiers="virtual"> - <return type="String"> - </return> - <description> - Override this method to provide the name that will appear in the gizmo visibility menu. - </description> - </method> <method name="get_priority" qualifiers="virtual"> <return type="int"> </return> diff --git a/doc/classes/GLTFState.xml b/doc/classes/GLTFState.xml index a8e96ec8a9..8255cd73d0 100644 --- a/doc/classes/GLTFState.xml +++ b/doc/classes/GLTFState.xml @@ -109,6 +109,12 @@ <description> </description> </method> + <method name="get_unique_animation_names"> + <return type="Array"> + </return> + <description> + </description> + </method> <method name="get_unique_names"> <return type="Array"> </return> @@ -219,6 +225,14 @@ <description> </description> </method> + <method name="set_unique_animation_names"> + <return type="void"> + </return> + <argument index="0" name="unique_animation_names" type="Array"> + </argument> + <description> + </description> + </method> <method name="set_unique_names"> <return type="void"> </return> diff --git a/doc/classes/GLTFTexture.xml b/doc/classes/GLTFTexture.xml index c7f94ab0da..be2210331f 100644 --- a/doc/classes/GLTFTexture.xml +++ b/doc/classes/GLTFTexture.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="src_image" type="int" setter="set_src_image" getter="get_src_image" default="4"> + <member name="src_image" type="int" setter="set_src_image" getter="get_src_image" default="195773152"> </member> </members> <constants> diff --git a/doc/classes/Navigation2D.xml b/doc/classes/Navigation2D.xml deleted file mode 100644 index abac29bdb7..0000000000 --- a/doc/classes/Navigation2D.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="Navigation2D" inherits="Node2D" version="4.0"> - <brief_description> - 2D navigation and pathfinding node. - </brief_description> - <description> - Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of [NavigationPolygon] resources. These are automatically collected from child [NavigationRegion2D] nodes. - </description> - <tutorials> - <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link> - </tutorials> - <methods> - <method name="get_closest_point" qualifiers="const"> - <return type="Vector2"> - </return> - <argument index="0" name="to_point" type="Vector2"> - </argument> - <description> - Returns the point closest to the provided [code]to_point[/code] on the navigation mesh surface. - </description> - </method> - <method name="get_closest_point_owner" qualifiers="const"> - <return type="RID"> - </return> - <argument index="0" name="to_point" type="Vector2"> - </argument> - <description> - Returns the owner region RID for the point returned by [method get_closest_point]. - </description> - </method> - <method name="get_rid" qualifiers="const"> - <return type="RID"> - </return> - <description> - </description> - </method> - <method name="get_simple_path" qualifiers="const"> - <return type="PackedVector2Array"> - </return> - <argument index="0" name="start" type="Vector2"> - </argument> - <argument index="1" name="end" type="Vector2"> - </argument> - <argument index="2" name="optimize" type="bool" default="true"> - </argument> - <description> - Returns the path between two given points. Points are in local coordinate space. If [code]optimize[/code] is [code]true[/code] (the default), the path is smoothed by merging path segments where possible. - </description> - </method> - </methods> - <members> - <member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="10.0"> - </member> - <member name="edge_connection_margin" type="float" setter="set_edge_connection_margin" getter="get_edge_connection_margin" default="100.0"> - </member> - </members> - <constants> - </constants> -</class> diff --git a/doc/classes/Navigation3D.xml b/doc/classes/Navigation3D.xml deleted file mode 100644 index e7a4fe3c43..0000000000 --- a/doc/classes/Navigation3D.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="Navigation3D" inherits="Node3D" version="4.0"> - <brief_description> - Mesh-based navigation and pathfinding node. - </brief_description> - <description> - Provides navigation and pathfinding within a collection of [NavigationMesh]es. These will be automatically collected from child [NavigationRegion3D] nodes. In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on. - </description> - <tutorials> - <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link> - </tutorials> - <methods> - <method name="get_closest_point" qualifiers="const"> - <return type="Vector3"> - </return> - <argument index="0" name="to_point" type="Vector3"> - </argument> - <description> - Returns the point closest to the provided [code]to_point[/code] on the navigation mesh surface. - </description> - </method> - <method name="get_closest_point_normal" qualifiers="const"> - <return type="Vector3"> - </return> - <argument index="0" name="to_point" type="Vector3"> - </argument> - <description> - Returns the normal for the point returned by [method get_closest_point]. - </description> - </method> - <method name="get_closest_point_owner" qualifiers="const"> - <return type="RID"> - </return> - <argument index="0" name="to_point" type="Vector3"> - </argument> - <description> - Returns the owner region RID for the point returned by [method get_closest_point]. - </description> - </method> - <method name="get_closest_point_to_segment" qualifiers="const"> - <return type="Vector3"> - </return> - <argument index="0" name="start" type="Vector3"> - </argument> - <argument index="1" name="end" type="Vector3"> - </argument> - <argument index="2" name="use_collision" type="bool" default="false"> - </argument> - <description> - Returns the closest point between the navigation surface and the segment. - </description> - </method> - <method name="get_rid" qualifiers="const"> - <return type="RID"> - </return> - <description> - </description> - </method> - <method name="get_simple_path" qualifiers="const"> - <return type="PackedVector3Array"> - </return> - <argument index="0" name="start" type="Vector3"> - </argument> - <argument index="1" name="end" type="Vector3"> - </argument> - <argument index="2" name="optimize" type="bool" default="true"> - </argument> - <description> - Returns the path between two given points. Points are in local coordinate space. If [code]optimize[/code] is [code]true[/code] (the default), the agent properties associated with each [NavigationMesh] (radius, height, etc.) are considered in the path calculation, otherwise they are ignored. - </description> - </method> - </methods> - <members> - <member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.3"> - </member> - <member name="edge_connection_margin" type="float" setter="set_edge_connection_margin" getter="get_edge_connection_margin" default="5.0"> - </member> - <member name="up_vector" type="Vector3" setter="set_up_vector" getter="get_up_vector" default="Vector3( 0, 1, 0 )"> - Defines which direction is up. By default, this is [code](0, 1, 0)[/code], which is the world's "up" direction. - </member> - </members> - <constants> - </constants> -</class> diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml index 5a9c31ef67..59bf06eaf2 100644 --- a/doc/classes/NavigationAgent2D.xml +++ b/doc/classes/NavigationAgent2D.xml @@ -4,7 +4,7 @@ 2D Agent used in navigation for collision avoidance. </brief_description> <description> - 2D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. This can be done by having the agent as a child of a [Navigation2D] node, or using [method set_navigation]. [NavigationAgent2D] is physics safe. + 2D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent2D] is physics safe. </description> <tutorials> </tutorials> @@ -37,13 +37,6 @@ Returns which index the agent is currently on in the navigation path's [PackedVector2Array]. </description> </method> - <method name="get_navigation" qualifiers="const"> - <return type="Node"> - </return> - <description> - Returns the [Navigation2D] node that the agent is using for its navigation system. - </description> - </method> <method name="get_next_location"> <return type="Vector2"> </return> @@ -79,15 +72,6 @@ Returns true if the target location is reached. The target location is set using [method set_target_location]. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [method get_final_location]. </description> </method> - <method name="set_navigation"> - <return type="void"> - </return> - <argument index="0" name="navigation" type="Node"> - </argument> - <description> - Sets the [Navigation2D] node used by the agent. Useful when you don't want to make the agent a child of a [Navigation2D] node. - </description> - </method> <method name="set_target_location"> <return type="void"> </return> diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml index f9df1d390b..7a130e9591 100644 --- a/doc/classes/NavigationAgent3D.xml +++ b/doc/classes/NavigationAgent3D.xml @@ -4,7 +4,7 @@ 3D Agent used in navigation for collision avoidance. </brief_description> <description> - 3D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. This can be done by having the agent as a child of a [Navigation3D] node, or using [method set_navigation]. [NavigationAgent3D] is physics safe. + 3D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent3D] is physics safe. </description> <tutorials> </tutorials> @@ -37,13 +37,6 @@ Returns which index the agent is currently on in the navigation path's [PackedVector3Array]. </description> </method> - <method name="get_navigation" qualifiers="const"> - <return type="Node"> - </return> - <description> - Returns the [Navigation3D] node that the agent is using for its navigation system. - </description> - </method> <method name="get_next_location"> <return type="Vector3"> </return> @@ -79,15 +72,6 @@ Returns true if the target location is reached. The target location is set using [method set_target_location]. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [method get_final_location]. </description> </method> - <method name="set_navigation"> - <return type="void"> - </return> - <argument index="0" name="navigation" type="Node"> - </argument> - <description> - Sets the [Navigation3D] node used by the agent. Useful when you don't want to make the agent a child of a [Navigation3D] node. - </description> - </method> <method name="set_target_location"> <return type="void"> </return> diff --git a/doc/classes/NavigationObstacle2D.xml b/doc/classes/NavigationObstacle2D.xml index ddd96975f1..2e94eb0bba 100644 --- a/doc/classes/NavigationObstacle2D.xml +++ b/doc/classes/NavigationObstacle2D.xml @@ -4,27 +4,11 @@ 2D Obstacle used in navigation for collision avoidance. </brief_description> <description> - 2D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. This can be done by having the obstacle as a child of a [Navigation2D] node, or using [method set_navigation]. [NavigationObstacle2D] is physics safe. + 2D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. [NavigationObstacle2D] is physics safe. </description> <tutorials> </tutorials> <methods> - <method name="get_navigation" qualifiers="const"> - <return type="Node"> - </return> - <description> - Returns the [Navigation2D] node that the obstacle is using for its navigation system. - </description> - </method> - <method name="set_navigation"> - <return type="void"> - </return> - <argument index="0" name="navigation" type="Node"> - </argument> - <description> - Sets the [Navigation2D] node used by the obstacle. Useful when you don't want to make the obstacle a child of a [Navigation2D] node. - </description> - </method> </methods> <constants> </constants> diff --git a/doc/classes/NavigationObstacle3D.xml b/doc/classes/NavigationObstacle3D.xml index e01a40ed73..d7454a7bea 100644 --- a/doc/classes/NavigationObstacle3D.xml +++ b/doc/classes/NavigationObstacle3D.xml @@ -4,27 +4,11 @@ 3D Obstacle used in navigation for collision avoidance. </brief_description> <description> - 3D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. This can be done by having the obstacle as a child of a [Navigation3D] node, or using [method set_navigation]. [NavigationObstacle3D] is physics safe. + 3D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. [NavigationObstacle3D] is physics safe. </description> <tutorials> </tutorials> <methods> - <method name="get_navigation" qualifiers="const"> - <return type="Node"> - </return> - <description> - Returns the [Navigation3D] node that the obstacle is using for its navigation system. - </description> - </method> - <method name="set_navigation"> - <return type="void"> - </return> - <argument index="0" name="navigation" type="Node"> - </argument> - <description> - Sets the [Navigation3D] node used by the obstacle. Useful when you don't want to make the obstacle a child of a [Navigation3D] node. - </description> - </method> </methods> <constants> </constants> diff --git a/doc/classes/NavigationRegion2D.xml b/doc/classes/NavigationRegion2D.xml index aef114e1db..33a3f04c3d 100644 --- a/doc/classes/NavigationRegion2D.xml +++ b/doc/classes/NavigationRegion2D.xml @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="NavigationRegion2D" inherits="Node2D" version="4.0"> <brief_description> + A region of the 2D navigation map. </brief_description> <description> + A region of the navigation map. It tells the [NavigationServer2D] what can be navigated and what cannot, based on its [NavigationPolygon] resource. + Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using [method NavigationServer2D.map_set_edge_connection_margin]. + [b]Note:[/b] Overlapping two regions' polygons is not enough for connecting two regions. They must share a similar edge. </description> <tutorials> </tutorials> @@ -10,8 +14,13 @@ </methods> <members> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> + Determines if the [NavigationRegion2D] is enabled or disabled. + </member> + <member name="layers" type="int" setter="set_layers" getter="get_layers" default="1"> + A bitfield determining all layers the region belongs to. These layers can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. </member> <member name="navpoly" type="NavigationPolygon" setter="set_navigation_polygon" getter="get_navigation_polygon"> + The [NavigationPolygon] resource to use. </member> </members> <constants> diff --git a/doc/classes/NavigationRegion3D.xml b/doc/classes/NavigationRegion3D.xml index b70bfb6596..2904ba4200 100644 --- a/doc/classes/NavigationRegion3D.xml +++ b/doc/classes/NavigationRegion3D.xml @@ -4,7 +4,8 @@ A region of the navigation map. </brief_description> <description> - A region of the navigation map. It tells the [Navigation3D] node what can be navigated and what cannot, based on the [NavigationMesh] resource. This should be a child of a [Navigation3D] node (even not a direct child). + A region of the navigation map. It tells the [NavigationServer3D] what can be navigated and what cannot, based on its [NavigationMesh] resource. + Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using [method NavigationServer3D.map_set_edge_connection_margin]. </description> <tutorials> </tutorials> @@ -21,6 +22,9 @@ <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> Determines if the [NavigationRegion3D] is enabled or disabled. </member> + <member name="layers" type="int" setter="set_layers" getter="get_layers" default="1"> + A bitfield determining all layers the region belongs to. These layers can be checked upon when requesting a path with [method NavigationServer3D.map_get_path]. + </member> <member name="navmesh" type="NavigationMesh" setter="set_navigation_mesh" getter="get_navigation_mesh"> The [NavigationMesh] resource to use. </member> diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml index 5f0b04487e..4f34a8a424 100644 --- a/doc/classes/NavigationServer2D.xml +++ b/doc/classes/NavigationServer2D.xml @@ -4,7 +4,12 @@ Server interface for low-level 2D navigation access </brief_description> <description> - NavigationServer2D is the server responsible for all 2D navigation. It creates the agents, maps, and regions for navigation to work as expected. This keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. + NavigationServer2D is the server responsible for all 2D navigation. It handles several objects, namely maps, regions and agents. + Maps are made up of regions, which are made of navigation polygons. Together, they define the navigable areas in the 2D world. For two regions to be connected to each other, they must share a similar edge. An edges is considered connected to another if both of its two vertices are at a distance less than [code]edge_connection_margin[/code] to the respective other edge's vertex. + You may assign navigation layers to regions with [method NavigationServer2D.region_set_layers], which then can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. This allows allowing or forbidding some areas to 2D objects. + To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. + [b]Note:[/b] the collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing and agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. + This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. </description> <tutorials> <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link> @@ -207,8 +212,10 @@ </argument> <argument index="3" name="optimize" type="bool"> </argument> + <argument index="4" name="layers" type="int" default="1"> + </argument> <description> - Returns the navigation path to reach the destination from the origin, while avoiding static obstacles. + Returns the navigation path to reach the destination from the origin. [code]layers[/code] is a bitmask of all region layers that are allowed to be in the path. </description> </method> <method name="map_is_active" qualifiers="const"> @@ -260,6 +267,26 @@ Creates a new region. </description> </method> + <method name="region_get_layers" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="region" type="RID"> + </argument> + <description> + Returns the region's layers. + </description> + </method> + <method name="region_set_layers" qualifiers="const"> + <return type="void"> + </return> + <argument index="0" name="region" type="RID"> + </argument> + <argument index="1" name="layers" type="int"> + </argument> + <description> + Set the region's layers. This allows selecting regions from a path request (when using [method NavigationServer2D.map_get_path]). + </description> + </method> <method name="region_set_map" qualifiers="const"> <return type="void"> </return> diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml index 95890c4b4c..0653c0d27d 100644 --- a/doc/classes/NavigationServer3D.xml +++ b/doc/classes/NavigationServer3D.xml @@ -4,7 +4,12 @@ Server interface for low-level 3D navigation access </brief_description> <description> - NavigationServer3D is the server responsible for all 3D navigation. It creates the agents, maps, and regions for navigation to work as expected. This keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. + NavigationServer3D is the server responsible for all 3D navigation. It handles several objects, namely maps, regions and agents. + Maps are made up of regions, which are made of navigation meshes. Together, they define the navigable areas in the 3D world. For two regions to be connected to each other, they must share a similar edge. An edges is considered connected to another if both of its two vertices are at a distance less than [code]edge_connection_margin[/code] to the respective other edge's vertex. + You may assign navigation layers to regions with [method NavigationServer3D.region_set_layers], which then can be checked upon when requesting a path with [method NavigationServer3D.map_get_path]. This allows allowing or forbidding some areas to 3D objects. + To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. + [b]Note:[/b] the collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing and agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. + This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. </description> <tutorials> <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link> @@ -219,7 +224,7 @@ <argument index="0" name="map" type="RID"> </argument> <description> - Returns the edge connection margin of the map. + Returns the edge connection margin of the map. This distance is the minimum vertex distance needed to connect two edges from different regions. </description> </method> <method name="map_get_path" qualifiers="const"> @@ -233,8 +238,10 @@ </argument> <argument index="3" name="optimize" type="bool"> </argument> + <argument index="4" name="layers" type="int" default="1"> + </argument> <description> - Returns the navigation path to reach the destination from the origin. + Returns the navigation path to reach the destination from the origin. [code]layers[/code] is a bitmask of all region layers that are allowed to be in the path. </description> </method> <method name="map_get_up" qualifiers="const"> @@ -285,7 +292,7 @@ <argument index="1" name="margin" type="float"> </argument> <description> - Set the map edge connection margein used to weld the compatible region edges. + Set the map edge connection margin used to weld the compatible region edges. </description> </method> <method name="map_set_up" qualifiers="const"> @@ -328,6 +335,26 @@ Creates a new region. </description> </method> + <method name="region_get_layers" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="region" type="RID"> + </argument> + <description> + Returns the region's layers. + </description> + </method> + <method name="region_set_layers" qualifiers="const"> + <return type="void"> + </return> + <argument index="0" name="region" type="RID"> + </argument> + <argument index="1" name="layers" type="int"> + </argument> + <description> + Set the region's layers. This allows selecting regions from a path request (when using [method NavigationServer3D.map_get_path]). + </description> + </method> <method name="region_set_map" qualifiers="const"> <return type="void"> </return> diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 1fa82adb7a..701a430538 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -58,7 +58,7 @@ <return type="RID"> </return> <description> - Creates an [Area2D]. + Creates an [Area2D]. After creating an [Area2D] with this method, assign it to a space using [method area_set_space] to use the created [Area2D] in the physics world. </description> </method> <method name="area_get_canvas_instance_id" qualifiers="const"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index a1e5e60b4a..ac63c5da79 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -169,6 +169,7 @@ </return> <description> Saves the configuration to the [code]project.godot[/code] file. + [b]Note:[/b] This method is intended to be used by editor plugins, as modified [ProjectSettings] can't be loaded back in the running app. If you want to change project settings in exported projects, use [method save_custom] to save [code]override.cfg[/code] file. </description> </method> <method name="save_custom"> @@ -177,7 +178,7 @@ <argument index="0" name="file" type="String"> </argument> <description> - Saves the configuration to a custom file. The file extension must be [code].godot[/code] (to save in text-based [ConfigFile] format) or [code].binary[/code] (to save in binary format). + Saves the configuration to a custom file. The file extension must be [code].godot[/code] (to save in text-based [ConfigFile] format) or [code].binary[/code] (to save in binary format). You can also save [code]override.cfg[/code] file, which is also text, but can be used in exported projects unlike other formats. </description> </method> <method name="set_initial_value"> @@ -468,7 +469,7 @@ <member name="debug/shapes/collision/max_contacts_displayed" type="int" setter="" getter="" default="10000"> Maximum number of contact points between collision shapes to display when "Visible Collision Shapes" is enabled in the Debug menu. </member> - <member name="debug/shapes/collision/shape_color" type="Color" setter="" getter="" default="Color( 0, 0.6, 0.7, 0.5 )"> + <member name="debug/shapes/collision/shape_color" type="Color" setter="" getter="" default="Color( 0, 0.6, 0.7, 0.42 )"> Color of the collision shapes, visible when "Visible Collision Shapes" is enabled in the Debug menu. </member> <member name="debug/shapes/navigation/disabled_geometry_color" type="Color" setter="" getter="" default="Color( 1, 0.7, 0.1, 0.4 )"> @@ -487,7 +488,7 @@ Position offset for tooltips, relative to the mouse cursor's hotspot. </member> <member name="display/window/dpi/allow_hidpi" type="bool" setter="" getter="" default="false"> - If [code]true[/code], allows HiDPI display on Windows and macOS. This setting has no effect on desktop Linux, as DPI-awareness fallbacks are not supported there. + If [code]true[/code], allows HiDPI display on Windows, macOS, and the HTML5 platform. This setting has no effect on desktop Linux, as DPI-awareness fallbacks are not supported there. </member> <member name="display/window/energy_saving/keep_screen_on" type="bool" setter="" getter="" default="true"> If [code]true[/code], keeps the screen on (even in case of inactivity), so the screensaver does not take over. Works on desktop and mobile platforms. @@ -757,6 +758,66 @@ <member name="internationalization/rendering/text_driver" type="String" setter="" getter="" default=""""> Specifies the [TextServer] to use. If left empty, the default will be used. </member> + <member name="layer_names/2d_navigation/layer_0" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 0. If left empty, the layer will display as "Layer 0". + </member> + <member name="layer_names/2d_navigation/layer_1" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 1. If left empty, the layer will display as "Layer 1". + </member> + <member name="layer_names/2d_navigation/layer_10" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 10. If left empty, the layer will display as "Layer 10". + </member> + <member name="layer_names/2d_navigation/layer_11" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 11. If left empty, the layer will display as "Layer 11". + </member> + <member name="layer_names/2d_navigation/layer_12" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 12. If left empty, the layer will display as "Layer 12". + </member> + <member name="layer_names/2d_navigation/layer_13" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 13. If left empty, the layer will display as "Layer 13". + </member> + <member name="layer_names/2d_navigation/layer_14" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 14. If left empty, the layer will display as "Layer 14". + </member> + <member name="layer_names/2d_navigation/layer_15" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 15. If left empty, the layer will display as "Layer 15". + </member> + <member name="layer_names/2d_navigation/layer_16" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 16. If left empty, the layer will display as "Layer 16". + </member> + <member name="layer_names/2d_navigation/layer_17" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 17. If left empty, the layer will display as "Layer 17". + </member> + <member name="layer_names/2d_navigation/layer_18" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 18. If left empty, the layer will display as "Layer 18". + </member> + <member name="layer_names/2d_navigation/layer_19" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 19. If left empty, the layer will display as "Layer 19". + </member> + <member name="layer_names/2d_navigation/layer_2" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 2. If left empty, the layer will display as "Layer 2". + </member> + <member name="layer_names/2d_navigation/layer_3" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 3. If left empty, the layer will display as "Layer 3". + </member> + <member name="layer_names/2d_navigation/layer_4" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 4. If left empty, the layer will display as "Layer 4". + </member> + <member name="layer_names/2d_navigation/layer_5" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 5. If left empty, the layer will display as "Layer 5". + </member> + <member name="layer_names/2d_navigation/layer_6" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 6. If left empty, the layer will display as "Layer 6". + </member> + <member name="layer_names/2d_navigation/layer_7" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 7. If left empty, the layer will display as "Layer 7". + </member> + <member name="layer_names/2d_navigation/layer_8" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 8. If left empty, the layer will display as "Layer 8". + </member> + <member name="layer_names/2d_navigation/layer_9" type="String" setter="" getter="" default=""""> + Optional name for the 2D navigation layer 9. If left empty, the layer will display as "Layer 9". + </member> <member name="layer_names/2d_physics/layer_0" type="String" setter="" getter="" default=""""> Optional name for the 2D physics layer 0. If left empty, the layer will display as "Layer 0". </member> @@ -877,6 +938,66 @@ <member name="layer_names/2d_render/layer_9" type="String" setter="" getter="" default=""""> Optional name for the 2D render layer 9. If left empty, the layer will display as "Layer 9". </member> + <member name="layer_names/3d_navigation/layer_0" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 0. If left empty, the layer will display as "Layer 0". + </member> + <member name="layer_names/3d_navigation/layer_1" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 1. If left empty, the layer will display as "Layer 1". + </member> + <member name="layer_names/3d_navigation/layer_10" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 10. If left empty, the layer will display as "Layer 10". + </member> + <member name="layer_names/3d_navigation/layer_11" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 11. If left empty, the layer will display as "Layer 11". + </member> + <member name="layer_names/3d_navigation/layer_12" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 12. If left empty, the layer will display as "Layer 12". + </member> + <member name="layer_names/3d_navigation/layer_13" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 13. If left empty, the layer will display as "Layer 13". + </member> + <member name="layer_names/3d_navigation/layer_14" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 14. If left empty, the layer will display as "Layer 14". + </member> + <member name="layer_names/3d_navigation/layer_15" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 15. If left empty, the layer will display as "Layer 15". + </member> + <member name="layer_names/3d_navigation/layer_16" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 16. If left empty, the layer will display as "Layer 16". + </member> + <member name="layer_names/3d_navigation/layer_17" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 17. If left empty, the layer will display as "Layer 17". + </member> + <member name="layer_names/3d_navigation/layer_18" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 18. If left empty, the layer will display as "Layer 18". + </member> + <member name="layer_names/3d_navigation/layer_19" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 19. If left empty, the layer will display as "Layer 19". + </member> + <member name="layer_names/3d_navigation/layer_2" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 2. If left empty, the layer will display as "Layer 2". + </member> + <member name="layer_names/3d_navigation/layer_3" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 3. If left empty, the layer will display as "Layer 3". + </member> + <member name="layer_names/3d_navigation/layer_4" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 4. If left empty, the layer will display as "Layer 4". + </member> + <member name="layer_names/3d_navigation/layer_5" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 5. If left empty, the layer will display as "Layer 5". + </member> + <member name="layer_names/3d_navigation/layer_6" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 6. If left empty, the layer will display as "Layer 6". + </member> + <member name="layer_names/3d_navigation/layer_7" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 7. If left empty, the layer will display as "Layer 7". + </member> + <member name="layer_names/3d_navigation/layer_8" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 8. If left empty, the layer will display as "Layer 8". + </member> + <member name="layer_names/3d_navigation/layer_9" type="String" setter="" getter="" default=""""> + Optional name for the 3D navigation layer 9. If left empty, the layer will display as "Layer 9". + </member> <member name="layer_names/3d_physics/layer_0" type="String" setter="" getter="" default=""""> Optional name for the 3D physics layer 0. If left empty, the layer will display as "Layer 0". </member> @@ -1019,6 +1140,18 @@ </member> <member name="mono/unhandled_exception_policy" type="int" setter="" getter="" default="0"> </member> + <member name="navigation/2d/default_cell_size" type="int" setter="" getter="" default="10"> + Default cell size for 2D navigation maps. See [method NavigationServer2D.map_set_cell_size]. + </member> + <member name="navigation/2d/default_edge_connection_margin" type="int" setter="" getter="" default="100"> + Default edge connection margin for 2D navigation maps. See [method NavigationServer2D.map_set_edge_connection_margin]. + </member> + <member name="navigation/3d/default_cell_size" type="float" setter="" getter="" default="0.3"> + Default cell size for 3D navigation maps. See [method NavigationServer3D.map_set_cell_size]. + </member> + <member name="navigation/3d/default_edge_connection_margin" type="float" setter="" getter="" default="5.0"> + Default edge connection margin for 3D navigation maps. See [method NavigationServer3D.map_set_edge_connection_margin]. + </member> <member name="network/limits/debugger/max_chars_per_second" type="int" setter="" getter="" default="32768"> Maximum amount of characters allowed to send as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. </member> diff --git a/doc/classes/RayCast3D.xml b/doc/classes/RayCast3D.xml index 681cfcd4ce..443890438f 100644 --- a/doc/classes/RayCast3D.xml +++ b/doc/classes/RayCast3D.xml @@ -136,11 +136,11 @@ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> - <member name="debug_shape_custom_color" type="Color" setter="set_debug_shape__custom_color" getter="get_debug_shape_custom_color" default="Color( 0.0, 0.0, 0.0 )"> + <member name="debug_shape_custom_color" type="Color" setter="set_debug_shape_custom_color" getter="get_debug_shape_custom_color" default="Color( 0, 0, 0, 1 )"> The custom color to use to draw the shape in the editor and at run-time if [b]Visible Collision Shapes[/b] is enabled in the [b]Debug[/b] menu. This color will be highlighted at run-time if the [RayCast3D] is colliding with something. If set to [code]Color(0.0, 0.0, 0.0)[/code] (by default), the color set in [member ProjectSettings.debug/shapes/collision/shape_color] is used. </member> - <member name="debug_shape_thickness" type="int" setter="set_debug_shape_thickness" getter="get_debug_shape_thickness" default="1"> + <member name="debug_shape_thickness" type="float" setter="set_debug_shape_thickness" getter="get_debug_shape_thickness" default="2.0"> If set to [code]1[/code], a line is used as the debug shape. Otherwise, a truncated pyramid is drawn to represent the [RayCast3D]. Requires [b]Visible Collision Shapes[/b] to be enabled in the [b]Debug[/b] menu for the debug shape to be visible at run-time. </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index dfd4a5c2d5..d2b95fda20 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -2704,11 +2704,14 @@ <description> Copies the viewport to a region of the screen specified by [code]rect[/code]. If [method viewport_set_render_direct_to_screen] is [code]true[/code], then the viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to. For example, you can set the root viewport to not render at all with the following code: - [codeblock] + FIXME: The method seems to be non-existent. + [codeblocks] + [gdscript] func _ready(): get_viewport().set_attach_to_screen_rect(Rect2()) $Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600)) - [/codeblock] + [/gdscript] + [/codeblocks] Using this can result in significant optimization, especially on lower-end devices. However, it comes at the cost of having to manage your viewports manually. For a further optimization see, [method viewport_set_render_direct_to_screen]. </description> </method> diff --git a/doc/classes/RichTextEffect.xml b/doc/classes/RichTextEffect.xml index 726b26fbc7..edab35f162 100644 --- a/doc/classes/RichTextEffect.xml +++ b/doc/classes/RichTextEffect.xml @@ -6,10 +6,16 @@ <description> A custom effect for use with [RichTextLabel]. [b]Note:[/b] For a [RichTextEffect] to be usable, a BBCode tag must be defined as a member variable called [code]bbcode[/code] in the script. - [codeblock] + [codeblocks] + [gdscript] # The RichTextEffect will be usable like this: `[example]Some text[/example]` var bbcode = "example" - [/codeblock] + [/gdscript] + [csharp] + // The RichTextEffect will be usable like this: `[example]Some text[/example]` + public string bbcode = "example"; + [/csharp] + [/codeblocks] [b]Note:[/b] As soon as a [RichTextLabel] contains at least one [RichTextEffect], it will continuously process the effect unless the project is paused. This may impact battery life negatively. </description> <tutorials> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index c54e2f4b88..e1f6830eb2 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -69,15 +69,33 @@ <description> Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this [SceneTree]. If [code]process_always[/code] is set to [code]false[/code], pausing the [SceneTree] will also pause the timer. Commonly used to create a one-shot delay timer as in the following example: - [codeblock] + [codeblocks] + [gdscript] func some_function(): print("start") yield(get_tree().create_timer(1.0), "timeout") print("end") - [/codeblock] + [/gdscript] + [csharp] + public async void SomeFunction() + { + GD.Print("start"); + await ToSignal(GetTree().CreateTimer(1.0f), "timeout"); + GD.Print("end"); + } + [/csharp] + [/codeblocks] The timer will be automatically freed after its time elapses. </description> </method> + <method name="get_first_node_in_group"> + <return type="Node"> + </return> + <argument index="0" name="group" type="StringName"> + </argument> + <description> + </description> + </method> <method name="get_frame" qualifiers="const"> <return type="int"> </return> diff --git a/doc/classes/SceneTreeTimer.xml b/doc/classes/SceneTreeTimer.xml index a4a83fa65b..b223bf6821 100644 --- a/doc/classes/SceneTreeTimer.xml +++ b/doc/classes/SceneTreeTimer.xml @@ -6,12 +6,22 @@ <description> A one-shot timer managed by the scene tree, which emits [signal timeout] on completion. See also [method SceneTree.create_timer]. As opposed to [Timer], it does not require the instantiation of a node. Commonly used to create a one-shot delay timer as in the following example: - [codeblock] + [codeblocks] + [gdscript] func some_function(): print("Timer started.") yield(get_tree().create_timer(1.0), "timeout") print("Timer ended.") - [/codeblock] + [/gdscript] + [csharp] + public async void SomeFunction() + { + GD.Print("Timer started."); + await ToSignal(GetTree().CreateTimer(1.0f), "timeout"); + GD.Print("Timer ended."); + } + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> diff --git a/doc/classes/ScriptCreateDialog.xml b/doc/classes/ScriptCreateDialog.xml index aa60ecb12b..7185213c44 100644 --- a/doc/classes/ScriptCreateDialog.xml +++ b/doc/classes/ScriptCreateDialog.xml @@ -5,12 +5,24 @@ </brief_description> <description> The [ScriptCreateDialog] creates script files according to a given template for a given scripting language. The standard use is to configure its fields prior to calling one of the [method Window.popup] methods. - [codeblock] + [codeblocks] + [gdscript] func _ready(): - dialog.config("Node", "res://new_node.gd") # For in-engine types - dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types + var dialog = ScriptCreateDialog.new(); + dialog.config("Node", "res://new_node.gd") # For in-engine types. + dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types. dialog.popup_centered() - [/codeblock] + [/gdscript] + [csharp] + public override void _Ready() + { + var dialog = new ScriptCreateDialog(); + dialog.Config("Node", "res://NewNode.cs"); // For in-engine types. + dialog.Config("\"res://BaseNode.cs\"", "res://DerivedNode.cs"); // For script types. + dialog.PopupCentered(); + } + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml index a08d4f5b44..7e2481f458 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -6,13 +6,22 @@ <description> SpinBox is a numerical input text field. It allows entering integers and floats. [b]Example:[/b] - [codeblock] + [codeblocks] + [gdscript] var spin_box = SpinBox.new() add_child(spin_box) var line_edit = spin_box.get_line_edit() line_edit.context_menu_enabled = false spin_box.align = LineEdit.ALIGN_RIGHT - [/codeblock] + [/gdscript] + [csharp] + var spinBox = new SpinBox(); + AddChild(spinBox); + var lineEdit = spinBox.GetLineEdit(); + lineEdit.ContextMenuEnabled = false; + spinBox.Align = LineEdit.AlignEnum.Right; + [/csharp] + [/codeblocks] The above code will create a [SpinBox], disable context menu on it and set the text alignment to right. See [Range] class for more options over the [SpinBox]. [b]Note:[/b] [SpinBox] relies on an underlying [LineEdit] node. To theme a [SpinBox]'s background, add theme items for [LineEdit] and customize them. diff --git a/doc/classes/Sprite2D.xml b/doc/classes/Sprite2D.xml index 83235f0991..e4df753674 100644 --- a/doc/classes/Sprite2D.xml +++ b/doc/classes/Sprite2D.xml @@ -15,12 +15,29 @@ </return> <description> Returns a [Rect2] representing the Sprite2D's boundary in local coordinates. Can be used to detect if the Sprite2D was clicked. Example: - [codeblock] + [codeblocks] + [gdscript] func _input(event): if event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT: if get_rect().has_point(to_local(event.position)): print("A click!") - [/codeblock] + [/gdscript] + [csharp] + public override void _Input(InputEvent inputEvent) + { + if (inputEvent is InputEventMouseButton inputEventMouse) + { + if (inputEventMouse.Pressed && inputEventMouse.ButtonIndex == (int)ButtonList.Left) + { + if (GetRect().HasPoint(ToLocal(inputEventMouse.Position))) + { + GD.Print("A click!"); + } + } + } + } + [/csharp] + [/codeblocks] </description> </method> <method name="is_pixel_opaque" qualifiers="const"> diff --git a/doc/classes/StreamPeer.xml b/doc/classes/StreamPeer.xml index a73d3c8212..a1b858acf6 100644 --- a/doc/classes/StreamPeer.xml +++ b/doc/classes/StreamPeer.xml @@ -212,9 +212,14 @@ <description> Puts a zero-terminated ASCII string into the stream prepended by a 32-bit unsigned integer representing its size. Note: To put an ASCII string without prepending its size, you can use [method put_data]: - [codeblock] + [codeblocks] + [gdscript] put_data("Hello world".to_ascii()) - [/codeblock] + [/gdscript] + [csharp] + PutData("Hello World".ToAscii()); + [/csharp] + [/codeblocks] </description> </method> <method name="put_u16"> @@ -261,9 +266,14 @@ <description> Puts a zero-terminated UTF-8 string into the stream prepended by a 32 bits unsigned integer representing its size. Note: To put an UTF-8 string without prepending its size, you can use [method put_data]: - [codeblock] + [codeblocks] + [gdscript] put_data("Hello world".to_utf8()) - [/codeblock] + [/gdscript] + [csharp] + PutData("Hello World".ToUTF8()); + [/csharp] + [/codeblocks] </description> </method> <method name="put_var"> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index c03f6357ab..475b17d395 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -163,11 +163,15 @@ <description> Returns the index of the [b]first[/b] case-sensitive occurrence of the specified string in this instance, or [code]-1[/code]. Optionally, the starting search index can be specified, continuing to the end of the string. [b]Note:[/b] If you just want to know whether a string contains a substring, use the [code]in[/code] operator as follows: - [codeblock] - # Will evaluate to `false`. - if "i" in "team": - pass - [/codeblock] + [codeblocks] + [gdscript] + print("i" in "team") # Will print `false`. + [/gdscript] + [csharp] + // C# has no in operator, but we can use `Contains()`. + GD.Print("team".Contains("i")); // Will print `false`. + [/csharp] + [/codeblocks] </description> </method> <method name="findn"> @@ -354,9 +358,14 @@ <description> Return a [String] which is the concatenation of the [code]parts[/code]. The separator between elements is the string providing this method. Example: - [codeblock] + [codeblocks] + [gdscript] print(", ".join(["One", "Two", "Three", "Four"])) - [/codeblock] + [/gdscript] + [csharp] + GD.Print(String.Join(",", new string[] {"One", "Two", "Three", "Four"})); + [/csharp] + [/codeblocks] </description> </method> <method name="json_escape"> @@ -654,13 +663,18 @@ The splits in the returned array are sorted in the same order as the original string, from left to right. If [code]maxsplit[/code] is specified, it defines the number of splits to do from the right up to [code]maxsplit[/code]. The default value of 0 means that all items are split, thus giving the same result as [method split]. Example: - [codeblock] + [codeblocks] + [gdscript] var some_string = "One,Two,Three,Four" var some_array = some_string.rsplit(",", true, 1) print(some_array.size()) # Prints 2 print(some_array[0]) # Prints "Four" print(some_array[1]) # Prints "Three,Two,One" - [/codeblock] + [/gdscript] + [csharp] + // There is no Rsplit. + [/csharp] + [/codeblocks] </description> </method> <method name="rstrip"> @@ -723,13 +737,21 @@ Splits the string by a [code]delimiter[/code] string and returns an array of the substrings. The [code]delimiter[/code] can be of any length. If [code]maxsplit[/code] is specified, it defines the number of splits to do from the left up to [code]maxsplit[/code]. The default value of [code]0[/code] means that all items are split. Example: - [codeblock] + [codeblocks] + [gdscript] var some_string = "One,Two,Three,Four" var some_array = some_string.split(",", true, 1) print(some_array.size()) # Prints 2 - print(some_array[0]) # Prints "One" - print(some_array[1]) # Prints "Two,Three,Four" - [/codeblock] + print(some_array[0]) # Prints "Four" + print(some_array[1]) # Prints "Three,Two,One" + [/gdscript] + [csharp] + var someString = "One,Two,Three,Four"; + var someArray = someString.Split(",", true); // This is as close as it gets to Godots API. + GD.Print(someArray[0]); // Prints "Four" + GD.Print(someArray[1]); // Prints "Three,Two,One" + [/csharp] + [/codeblocks] If you need to split strings with more complex rules, use the [RegEx] class instead. </description> </method> @@ -887,6 +909,13 @@ [/codeblocks] </description> </method> + <method name="validate_node_name"> + <return type="String"> + </return> + <description> + Removes any characters from the string that are prohibited in [Node] names ([code].[/code] [code]:[/code] [code]@[/code] [code]/[/code] [code]"[/code]). + </description> + </method> <method name="xml_escape"> <return type="String"> </return> diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 331de4284e..d145b4ce97 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -5,13 +5,22 @@ </brief_description> <description> The [SurfaceTool] is used to construct a [Mesh] by specifying vertex attributes individually. It can be used to construct a [Mesh] from a script. All properties except indices need to be added before calling [method add_vertex]. For example, to add vertex colors and UVs: - [codeblock] + [codeblocks] + [gdscript] var st = SurfaceTool.new() st.begin(Mesh.PRIMITIVE_TRIANGLES) st.set_color(Color(1, 0, 0)) st.set_uv(Vector2(0, 0)) st.set_vertex(Vector3(0, 0, 0)) - [/codeblock] + [/gdscript] + [csharp] + var st = new SurfaceTool(); + st.Begin(Mesh.PrimitiveType.Triangles); + st.SetColor(new Color(1, 0, 0)); + st.SetUv(new Vector2(0, 0)); + st.SetVertex(new Vector3(0, 0, 0)); + [/csharp] + [/codeblocks] The above [SurfaceTool] now contains one vertex of a triangle which has a UV coordinate and a specified [Color]. If another vertex were added without calling [method set_uv] or [method set_color], then the last values would be used. Vertex attributes must be passed [b]before[/b] calling [method add_vertex]. Failure to do so will result in an error when committing the vertex information to a mesh. Additionally, the attributes used before the first vertex is added determine the format of the mesh. For example, if you only add UVs to the first vertex, you cannot add color to any of the subsequent vertices. diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 1d50cd60e5..088bcd1c3c 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -402,13 +402,24 @@ <description> Perform a search inside the text. Search flags can be specified in the [enum SearchFlags] enum. Returns an empty [code]Dictionary[/code] if no result was found. Otherwise, returns a [code]Dictionary[/code] containing [code]line[/code] and [code]column[/code] entries, e.g: - [codeblock] - var result = search(key, flags, line, column) - if !result.is_empty(): + [codeblocks] + [gdscript] + var result = search("print", SEARCH_WHOLE_WORDS, 0, 0) + if !result.empty(): # Result found. var line_number = result.line var column_number = result.column - [/codeblock] + [/gdscript] + [csharp] + int[] result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0); + if (result.Length > 0) + { + // Result found. + int lineNumber = result[(int)TextEdit.SearchResult.Line]; + int columnNumber = result[(int)TextEdit.SearchResult.Column]; + } + [/csharp] + [/codeblocks] </description> </method> <method name="select"> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index a12ef614e3..7ed8ad6d4a 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -172,12 +172,22 @@ [b]Note:[/b] Data such as navigation polygons and collision shapes are not immediately updated for performance reasons. If you need these to be immediately updated, you can call [method update_dirty_quadrants]. Overriding this method also overrides it internally, allowing custom logic to be implemented when tiles are placed/removed: - [codeblock] + [codeblocks] + [gdscript] func set_cell(x, y, tile, flip_x=false, flip_y=false, transpose=false, autotile_coord=Vector2()) # Write your custom logic here. # To call the default method: .set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord) - [/codeblock] + [/gdscript] + [csharp] + public void SetCell(int x, int y, int tile, bool flipX = false, bool flipY = false, bool transpose = false, Vector2 autotileCoord = new Vector2()) + { + // Write your custom logic here. + // To call the default method: + base.SetCell(x, y, tile, flipX, flipY, transpose, autotileCoord); + } + [/csharp] + [/codeblocks] </description> </method> <method name="set_cellv"> @@ -262,6 +272,9 @@ </method> </methods> <members> + <member name="bake_navigation" type="bool" setter="set_bake_navigation" getter="is_baking_navigation" default="false"> + If [code]true[/code], this TileMap bakes a navigation region. + </member> <member name="cell_clip_uv" type="bool" setter="set_clip_uv" getter="get_clip_uv" default="false"> If [code]true[/code], the cell's UVs will be clipped. </member> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 8502707096..a09f1bf470 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -6,16 +6,30 @@ <description> This shows a tree of items that can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like text editing, buttons and popups. It can be useful for structured displays and interactions. Trees are built via code, using [TreeItem] objects to create the structure. They have a single root but multiple roots can be simulated if a dummy hidden root is added. - [codeblock] + [codeblocks] + [gdscript] func _ready(): var tree = Tree.new() var root = tree.create_item() - tree.set_hide_root(true) + tree.hide_root = true var child1 = tree.create_item(root) var child2 = tree.create_item(root) var subchild1 = tree.create_item(child1) subchild1.set_text(0, "Subchild1") - [/codeblock] + [/gdscript] + [csharp] + public override void _Ready() + { + var tree = new Tree(); + TreeItem root = tree.CreateItem(); + tree.HideRoot = true; + TreeItem child1 = tree.CreateItem(root); + TreeItem child2 = tree.CreateItem(root); + TreeItem subchild1 = tree.CreateItem(child1); + subchild1.SetText(0, "Subchild1"); + } + [/csharp] + [/codeblocks] To iterate over all the [TreeItem] objects in a [Tree] object, use [method TreeItem.get_next] and [method TreeItem.get_children] after getting the root through [method get_root]. You can use [method Object.free] on a [TreeItem] to remove it from the [Tree]. </description> <tutorials> @@ -152,13 +166,26 @@ </return> <description> Returns the currently edited item. Can be used with [signal item_edited] to get the item that was modified. - [codeblock] + [codeblocks] + [gdscript] func _ready(): $Tree.item_edited.connect(on_Tree_item_edited) func on_Tree_item_edited(): print($Tree.get_edited()) # This item just got edited (e.g. checked). - [/codeblock] + [/gdscript] + [csharp] + public override void _Ready() + { + GetNode<Tree>("Tree").ItemEdited += OnTreeItemEdited; + } + + public void OnTreeItemEdited() + { + GD.Print(GetNode<Tree>("Tree").GetEdited()); // This item just got edited (e.g. checked). + } + [/csharp] + [/codeblocks] </description> </method> <method name="get_edited_column" qualifiers="const"> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index 56ccaaf383..b32bb1e2d9 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -7,13 +7,22 @@ Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name [i]tween[/i] comes from [i]in-betweening[/i], an animation technique where you specify [i]keyframes[/i] and the computer interpolates the frames that appear between them. [Tween] is more suited than [AnimationPlayer] for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a [Tween] node; it would be difficult to do the same thing with an [AnimationPlayer] node. Here is a brief usage example that makes a 2D node move smoothly between two positions: - [codeblock] + [codeblocks] + [gdscript] var tween = get_node("Tween") tween.interpolate_property($Node2D, "position", Vector2(0, 0), Vector2(100, 100), 1, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT) tween.start() - [/codeblock] + [/gdscript] + [csharp] + var tween = GetNode<Tween>("Tween"); + tween.InterpolateProperty(GetNode<Node2D>("Node2D"), "position", + new Vector2(0, 0), new Vector2(100, 100), 1, + Tween.TransitionType.Linear, Tween.EaseType.InOut); + tween.Start(); + [/csharp] + [/codeblocks] Many methods require a property name, such as [code]"position"[/code] above. You can find the correct property name by hovering over the property in the Inspector. You can also provide the components of a property directly by using [code]"property:component"[/code] (eg. [code]position:x[/code]), where it would only apply to that particular component. Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls where the [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best. [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/tween_cheatsheet.png]Tween easing and transition types cheatsheet[/url] diff --git a/doc/classes/UDPServer.xml b/doc/classes/UDPServer.xml index aabfed85f0..0fc00f67f8 100644 --- a/doc/classes/UDPServer.xml +++ b/doc/classes/UDPServer.xml @@ -7,8 +7,9 @@ A simple server that opens a UDP socket and returns connected [PacketPeerUDP] upon receiving new packets. See also [method PacketPeerUDP.connect_to_host]. After starting the server ([method listen]), you will need to [method poll] it at regular intervals (e.g. inside [method Node._process]) for it to process new packets, delivering them to the appropriate [PacketPeerUDP], and taking new connections. Below a small example of how it can be used: - [codeblock] - # server.gd + [codeblocks] + [gdscript] + class_name Server extends Node var server := UDPServer.new() @@ -21,20 +22,57 @@ server.poll() # Important! if server.is_connection_available(): var peer : PacketPeerUDP = server.take_connection() - var pkt = peer.get_packet() + var packet = peer.get_packet() print("Accepted peer: %s:%s" % [peer.get_packet_ip(), peer.get_packet_port()]) - print("Received data: %s" % [pkt.get_string_from_utf8()]) + print("Received data: %s" % [packet.get_string_from_utf8()]) # Reply so it knows we received the message. - peer.put_packet(pkt) + peer.put_packet(packet) # Keep a reference so we can keep contacting the remote peer. peers.append(peer) for i in range(0, peers.size()): pass # Do something with the connected peers. + [/gdscript] + [csharp] + using Godot; + using System; + using System.Collections.Generic; - [/codeblock] - [codeblock] - # client.gd + public class Server : Node + { + public UDPServer Server = new UDPServer(); + public List<PacketPeerUDP> Peers = new List<PacketPeerUDP>(); + + public override void _Ready() + { + Server.Listen(4242); + } + + public override void _Process(float delta) + { + Server.Poll(); // Important! + if (Server.IsConnectionAvailable()) + { + PacketPeerUDP peer = Server.TakeConnection(); + byte[] packet = peer.GetPacket(); + GD.Print($"Accepted Peer: {peer.GetPacketIp()}:{peer.GetPacketPort()}"); + GD.Print($"Received Data: {packet.GetStringFromUTF8()}"); + // Reply so it knows we received the message. + peer.PutPacket(packet); + // Keep a reference so we can keep contacting the remote peer. + Peers.Add(peer); + } + foreach (var peer in Peers) + { + // Do something with the peers. + } + } + } + [/csharp] + [/codeblocks] + [codeblocks] + [gdscript] + class_name Client extends Node var udp := PacketPeerUDP.new() @@ -50,7 +88,37 @@ if udp.get_available_packet_count() > 0: print("Connected: %s" % udp.get_packet().get_string_from_utf8()) connected = true - [/codeblock] + [/gdscript] + [csharp] + using Godot; + using System; + + public class Client : Node + { + public PacketPeerUDP Udp = new PacketPeerUDP(); + public bool Connected = false; + + public override void _Ready() + { + Udp.ConnectToHost("127.0.0.1", 4242); + } + + public override void _Process(float delta) + { + if (!Connected) + { + // Try to contact server + Udp.PutPacket("The Answer Is..42!".ToUTF8()); + } + if (Udp.GetAvailablePacketCount() > 0) + { + GD.Print($"Connected: {Udp.GetPacket().GetStringFromUTF8()}"); + Connected = true; + } + } + } + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index e8124d0e6a..a0330de4fa 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -7,7 +7,8 @@ Helper to manage undo/redo operations in the editor or custom tools. It works by registering methods and property changes inside "actions". Common behavior is to create an action, then add do/undo calls to functions or property changes, then committing the action. Here's an example on how to add an action to the Godot editor's own [UndoRedo], from a plugin: - [codeblock] + [codeblocks] + [gdscript] var undo_redo = get_undo_redo() # Method of EditorPlugin. func do_something(): @@ -24,7 +25,37 @@ undo_redo.add_do_property(node, "position", Vector2(100,100)) undo_redo.add_undo_property(node, "position", node.position) undo_redo.commit_action() - [/codeblock] + [/gdscript] + [csharp] + public UndoRedo UndoRedo; + + public override void _Ready() + { + UndoRedo = GetUndoRedo(); // Method of EditorPlugin. + } + + public void DoSomething() + { + // Put your code here. + } + + public void UndoSomething() + { + // Put here the code that reverts what's done by "DoSomething()". + } + + private void OnMyButtonPressed() + { + var node = GetNode<Node2D>("MyNode2D"); + UndoRedo.CreateAction("Move the node"); + UndoRedo.AddDoMethod(this, nameof(DoSomething)); + UndoRedo.AddUndoMethod(this, nameof(UndoSomething)); + UndoRedo.AddDoProperty(node, "position", new Vector2(100, 100)); + UndoRedo.AddUndoProperty(node, "position", node.Position); + UndoRedo.CommitAction(); + } + [/csharp] + [/codeblocks] [method create_action], [method add_do_method], [method add_undo_method], [method add_do_property], [method add_undo_property], and [method commit_action] should be called one after the other, like in the example. Not doing so could lead to crashes. If you don't need to register a method, you can leave [method add_do_method] and [method add_undo_method] out; the same goes for properties. You can also register more than one method/property. </description> diff --git a/doc/classes/World2D.xml b/doc/classes/World2D.xml index 25033cdb09..20b3afbd0b 100644 --- a/doc/classes/World2D.xml +++ b/doc/classes/World2D.xml @@ -18,6 +18,9 @@ <member name="direct_space_state" type="PhysicsDirectSpaceState2D" setter="" getter="get_direct_space_state"> Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to [code]_physics_process(delta)[/code] in the main thread. </member> + <member name="navigation_map" type="RID" setter="" getter="get_navigation_map"> + The [RID] of this world's navigation map. Used by the [NavigationServer2D]. + </member> <member name="space" type="RID" setter="" getter="get_space"> The [RID] of this world's physics space resource. Used by the [PhysicsServer2D] for 2D physics, treating it as both a space and an area. </member> diff --git a/doc/classes/World3D.xml b/doc/classes/World3D.xml index fe92077432..610ecacff4 100644 --- a/doc/classes/World3D.xml +++ b/doc/classes/World3D.xml @@ -23,6 +23,9 @@ <member name="fallback_environment" type="Environment" setter="set_fallback_environment" getter="get_fallback_environment"> The World3D's fallback_environment will be used if the World3D's [Environment] fails or is missing. </member> + <member name="navigation_map" type="RID" setter="" getter="get_navigation_map"> + The [RID] of this world's navigation map. Used by the [NavigationServer3D]. + </member> <member name="scenario" type="RID" setter="" getter="get_scenario"> The World3D's visual scenario. </member> |