diff options
Diffstat (limited to 'doc/classes')
30 files changed, 420 insertions, 153 deletions
diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml index d6da4bc248..249e2a8f80 100644 --- a/doc/classes/ConfigFile.xml +++ b/doc/classes/ConfigFile.xml @@ -86,6 +86,7 @@ [/codeblocks] Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load. ConfigFiles can also contain manually written comment lines starting with a semicolon ([code];[/code]). Those lines will be ignored when parsing the file. Note that comments will be lost when saving the ConfigFile. This can still be useful for dedicated server configuration files, which are typically never overwritten without explicit user action. + [b]Note:[/b] The file extension given to a ConfigFile does not have any impact on its formatting or behavior. By convention, the [code].cfg[/code] extension is used here, but any other extension such as [code].ini[/code] is also valid. Since neither [code].cfg[/code] nor [code].ini[/code] are standardized, Godot's ConfigFile formatting may differ from files written by other programs. </description> <tutorials> </tutorials> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 5392189f6a..6602764cd4 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -921,7 +921,8 @@ Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. </member> <member name="auto_translate" type="bool" setter="set_auto_translate" getter="is_auto_translating" default="true"> - Toggles if any text should automatically change to its translated version depending on the current locale. + Toggles if any text should automatically change to its translated version depending on the current locale. Note that this will not affect any internal nodes (e.g. the popup of a [MenuButton]). + Also decides if the node's strings should be parsed for POT generation. </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0"> The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals. diff --git a/doc/classes/EditorSceneImporterMesh.xml b/doc/classes/EditorSceneImporterMesh.xml index b0f233da2f..c0c53ff255 100644 --- a/doc/classes/EditorSceneImporterMesh.xml +++ b/doc/classes/EditorSceneImporterMesh.xml @@ -27,6 +27,7 @@ }" /> <argument index="4" name="material" type="Material" default="null" /> <argument index="5" name="name" type="String" default="""" /> + <argument index="6" name="flags" type="int" default="0" /> <description> Creates a new surface, analogous to [method ArrayMesh.add_surface_from_arrays]. Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface. @@ -94,6 +95,13 @@ Returns the amount of surfaces that the mesh holds. </description> </method> + <method name="get_surface_format" qualifiers="const"> + <return type="int" /> + <argument index="0" name="surface_idx" type="int" /> + <description> + Returns the format of the surface that the mesh holds. + </description> + </method> <method name="get_surface_lod_count" qualifiers="const"> <return type="int" /> <argument index="0" name="surface_idx" type="int" /> diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 8b399f64c9..36590093bd 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -37,7 +37,7 @@ <method name="get_frames_drawn"> <return type="int" /> <description> - Returns the total number of frames drawn. If the render loop is disabled with [code]--disable-render-loop[/code] via command line, this returns [code]0[/code]. See also [method get_process_frames]. + Returns the total number of frames drawn. On headless platforms, or if the render loop is disabled with [code]--disable-render-loop[/code] via command line, [method get_frames_drawn] always returns [code]0[/code]. See [method get_process_frames]. </description> </method> <method name="get_frames_per_second" qualifiers="const"> @@ -67,7 +67,13 @@ <method name="get_physics_frames" qualifiers="const"> <return type="int" /> <description> - Returns the total number of frames passed since engine initialization which is advanced on each [b]physics frame[/b]. + Returns the total number of frames passed since engine initialization which is advanced on each [b]physics frame[/b]. See also [method get_process_frames]. + [method get_physics_frames] can be used to run expensive logic less often without relying on a [Timer]: + [codeblock] + func _physics_process(_delta): + if Engine.get_physics_frames() % 2 == 0: + pass # Run expensive logic only once every 2 physics frames here. + [/codeblock] </description> </method> <method name="get_physics_interpolation_fraction" qualifiers="const"> @@ -79,7 +85,13 @@ <method name="get_process_frames" qualifiers="const"> <return type="int" /> <description> - Returns the total number of frames passed since engine initialization which is advanced on each [b]process frame[/b], regardless of whether the render loop is enabled. See also [method get_frames_drawn]. + Returns the total number of frames passed since engine initialization which is advanced on each [b]process frame[/b], regardless of whether the render loop is enabled. See also [method get_frames_drawn] and [method get_physics_frames]. + [method get_process_frames] can be used to run expensive logic less often without relying on a [Timer]: + [codeblock] + func _process(_delta): + if Engine.get_process_frames() % 2 == 0: + pass # Run expensive logic only once every 2 process (render) frames here. + [/codeblock] </description> </method> <method name="get_singleton" qualifiers="const"> diff --git a/doc/classes/HScrollBar.xml b/doc/classes/HScrollBar.xml index 3bdd739cdf..36ff070a37 100644 --- a/doc/classes/HScrollBar.xml +++ b/doc/classes/HScrollBar.xml @@ -19,6 +19,9 @@ <theme_item name="decrement_highlight" data_type="icon" type="Texture2D"> Displayed when the mouse cursor hovers over the decrement button. </theme_item> + <theme_item name="decrement_pressed" data_type="icon" type="Texture2D"> + Displayed when the decrement button is being pressed. + </theme_item> <theme_item name="grabber" data_type="style" type="StyleBox"> Used as texture for the grabber, the draggable element representing current scroll. </theme_item> @@ -34,6 +37,9 @@ <theme_item name="increment_highlight" data_type="icon" type="Texture2D"> Displayed when the mouse cursor hovers over the increment button. </theme_item> + <theme_item name="increment_pressed" data_type="icon" type="Texture2D"> + Displayed when the increment button is being pressed. + </theme_item> <theme_item name="scroll" data_type="style" type="StyleBox"> Used as background of this [ScrollBar]. </theme_item> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index cd2f4eca18..52359b0ede 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -47,7 +47,8 @@ The light's strength multiplier (this is not a physical unit). For [OmniLight3D] and [SpotLight3D], changing this value will only change the light color's intensity, not the light's radius. </member> <member name="light_indirect_energy" type="float" setter="set_param" getter="get_param" default="1.0"> - Secondary multiplier used with indirect light (light bounces). Used with [VoxelGI]. + Secondary multiplier used with indirect light (light bounces). Used with [VoxelGI] and SDFGI (see [member Environment.sdfgi_enabled]). + [b]Note:[/b] This property is ignored if [member light_energy] is equal to [code]0.0[/code], as the light won't be present at all in the GI shader. </member> <member name="light_negative" type="bool" setter="set_negative" getter="is_negative" default="false"> If [code]true[/code], the light's effect is reversed, darkening areas and casting bright shadows. diff --git a/doc/classes/Listener2D.xml b/doc/classes/Listener2D.xml new file mode 100644 index 0000000000..27ee63d201 --- /dev/null +++ b/doc/classes/Listener2D.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="Listener2D" inherits="Node2D" version="4.0"> + <brief_description> + Overrides the location sounds are heard from. + </brief_description> + <description> + Once added to the scene tree and enabled using [method make_current], this node will override the location sounds are heard from. Only one [Listener2D] can be current. Using [method make_current] will disable the previous [Listener2D]. + If there is no active [Listener2D] in the current [Viewport], center of the screen will be used as a hearing point for the audio. [Listener2D] needs to be inside [SceneTree] to function. + </description> + <tutorials> + </tutorials> + <methods> + <method name="clear_current"> + <return type="void" /> + <description> + Disables the [Listener2D]. If it's not set as current, this method will have no effect. + </description> + </method> + <method name="is_current" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if this [Listener2D] is currently active. + </description> + </method> + <method name="make_current"> + <return type="void" /> + <description> + Makes the [Listener2D] active, setting it as the hearing point for the sounds. If there is already another active [Listener2D], it will be disabled. + This method will have no effect if the [Listener2D] is not added to [SceneTree]. + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/Listener3D.xml b/doc/classes/Listener3D.xml index 9cc803f241..5e1b2ce7fc 100644 --- a/doc/classes/Listener3D.xml +++ b/doc/classes/Listener3D.xml @@ -5,7 +5,6 @@ </brief_description> <description> Once added to the scene tree and enabled using [method make_current], this node will override the location sounds are heard from. This can be used to listen from a location different from the [Camera3D]. - [b]Note:[/b] There is no 2D equivalent for this node yet. </description> <tutorials> </tutorials> diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index bfa55c2d35..c774528a39 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -210,6 +210,8 @@ </constant> <constant name="ARRAY_FORMAT_CUSTOM_BASE" value="13" enum="ArrayFormat"> </constant> + <constant name="ARRAY_FORMAT_CUSTOM_BITS" value="3" enum="ArrayFormat"> + </constant> <constant name="ARRAY_FORMAT_CUSTOM0_SHIFT" value="13" enum="ArrayFormat"> </constant> <constant name="ARRAY_FORMAT_CUSTOM1_SHIFT" value="16" enum="ArrayFormat"> diff --git a/doc/classes/MeshLibrary.xml b/doc/classes/MeshLibrary.xml index 9e0292f946..1d07647ea7 100644 --- a/doc/classes/MeshLibrary.xml +++ b/doc/classes/MeshLibrary.xml @@ -45,6 +45,13 @@ Returns the item's mesh. </description> </method> + <method name="get_item_mesh_transform" qualifiers="const"> + <return type="Transform3D" /> + <argument index="0" name="id" type="int" /> + <description> + Returns the transform applied to the item's mesh. + </description> + </method> <method name="get_item_name" qualifiers="const"> <return type="String" /> <argument index="0" name="id" type="int" /> @@ -102,6 +109,14 @@ Sets the item's mesh. </description> </method> + <method name="set_item_mesh_transform"> + <return type="void" /> + <argument index="0" name="id" type="int" /> + <argument index="1" name="mesh_transform" type="Transform3D" /> + <description> + Sets the transform to apply to the item's mesh. + </description> + </method> <method name="set_item_name"> <return type="void" /> <argument index="0" name="id" type="int" /> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index c9e9a0699c..ed045f8390 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -92,12 +92,12 @@ Calls the [code]method[/code] on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: [codeblocks] [gdscript] - var node = Node2D.new() - node.call("set", "position", Vector2(42, 0)) + var node = Node3D.new() + node.call("rotate", Vector3(1.0, 0.0, 0.0), 1.571) [/gdscript] [csharp] - var node = new Node2D(); - node.Call("set", "position", new Vector2(42, 0)); + var node = new Node3D(); + node.Call("rotate", new Vector3(1f, 0f, 0f), 1.571f); [/csharp] [/codeblocks] [b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase). @@ -110,12 +110,12 @@ Calls the [code]method[/code] on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: [codeblocks] [gdscript] - var node = Node2D.new() - node.call_deferred("set", "position", Vector2(42, 0)) + var node = Node3D.new() + node.call_deferred("rotate", Vector3(1.0, 0.0, 0.0), 1.571) [/gdscript] [csharp] - var node = new Node2D(); - node.CallDeferred("set", "position", new Vector2(42, 0)); + var node = new Node3D(); + node.CallDeferred("rotate", new Vector3(1f, 0f, 0f), 1.571f); [/csharp] [/codeblocks] [b]Note:[/b] In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase). @@ -129,12 +129,12 @@ Calls the [code]method[/code] on the object and returns the result. Contrarily to [method call], this method does not support a variable number of arguments but expects all parameters to be via a single [Array]. [codeblocks] [gdscript] - var node = Node2D.new() - node.callv("set", ["position", Vector2(42, 0)]) + var node = Node3D.new() + node.callv("rotate", [Vector3(1.0, 0.0, 0.0), 1.571]) [/gdscript] [csharp] - var node = new Node2D(); - node.Callv("set", new Godot.Collections.Array { "position", new Vector2(42, 0) }); + var node = new Node3D(); + node.Callv("rotate", new Godot.Collections.Array { new Vector3(1f, 0f, 0f), 1.571f }); [/csharp] [/codeblocks] </description> @@ -331,7 +331,8 @@ <method name="get_class" qualifiers="const"> <return type="String" /> <description> - Returns the object's class as a [String]. + Returns the object's class as a [String]. See also [method is_class]. + [b]Note:[/b] [method get_class] does not take [code]class_name[/code] declarations into account. If the object has a [code]class_name[/code] defined, the base class name will be returned instead. </description> </method> <method name="get_incoming_connections" qualifiers="const"> @@ -441,7 +442,8 @@ <return type="bool" /> <argument index="0" name="class" type="String" /> <description> - Returns [code]true[/code] if the object inherits from the given [code]class[/code]. + Returns [code]true[/code] if the object inherits from the given [code]class[/code]. See also [method get_class]. + [b]Note:[/b] [method is_class] does not take [code]class_name[/code] declarations into account. If the object has a [code]class_name[/code] defined, [method is_class] will return [code]false[/code] for that name. </description> </method> <method name="is_connected" qualifiers="const"> diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index af92590da3..72f134e9e9 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -270,7 +270,7 @@ Converts UTF-8 encoded array to [String]. Slower than [method get_string_from_ascii] but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. Returns empty string if source array is not valid UTF-8 string. </description> </method> - <method name="has"> + <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="int" /> <description> diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index a5a5703bfa..2dfaefca23 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -56,7 +56,7 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> - <method name="has"> + <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="Color" /> <description> diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index 9e7dd8f99e..5c05dd9fa7 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -57,7 +57,7 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> - <method name="has"> + <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="float" /> <description> diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index ff4cf0edf8..921ca23859 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -57,7 +57,7 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> - <method name="has"> + <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="float" /> <description> diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index 2e9716b665..dfc9cbf939 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -57,7 +57,7 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> - <method name="has"> + <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="int" /> <description> diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 1e7fff3bc6..dd38a4f5c2 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -57,7 +57,7 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> - <method name="has"> + <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="int" /> <description> diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index 04113d4a2e..c2055531a5 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -57,7 +57,7 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> - <method name="has"> + <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="String" /> <description> diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index 76d3aff20e..51b7c951da 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -57,7 +57,7 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> - <method name="has"> + <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="Vector2" /> <description> diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index 1a35f71619..04a5e3d42e 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -56,7 +56,7 @@ Assigns the given value to all elements in the array. This can typically be used together with [method resize] to create an array with a given size and initialized elements. </description> </method> - <method name="has"> + <method name="has" qualifiers="const"> <return type="bool" /> <argument index="0" name="value" type="Vector3" /> <description> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 21d974e233..6fdce591ec 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -328,6 +328,9 @@ <member name="debug/gdscript/warnings/deprecated_keyword" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables warnings when deprecated keywords are used. </member> + <member name="debug/gdscript/warnings/empty_file" type="bool" setter="" getter="" default="true"> + If [code]true[/code], enables warnings when an empty file is parsed. + </member> <member name="debug/gdscript/warnings/enable" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables specific GDScript warnings (see [code]debug/gdscript/warnings/*[/code] settings). If [code]false[/code], disables all GDScript warnings. </member> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index c0d7cca840..b5be04fb01 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -3801,21 +3801,18 @@ <constant name="VIEWPORT_SDF_SCALE_MAX" value="3" enum="ViewportSDFScale"> </constant> <constant name="VIEWPORT_MSAA_DISABLED" value="0" enum="ViewportMSAA"> - Multisample antialiasing is disabled. + Multisample antialiasing for 3D is disabled. This is the default value, and also the fastest setting. </constant> <constant name="VIEWPORT_MSAA_2X" value="1" enum="ViewportMSAA"> - Multisample antialiasing uses 2 samples per pixel. + Multisample antialiasing uses 2 samples per pixel for 3D. This has a moderate impact on performance. </constant> <constant name="VIEWPORT_MSAA_4X" value="2" enum="ViewportMSAA"> - Multisample antialiasing uses 4 samples per pixel. + Multisample antialiasing uses 4 samples per pixel for 3D. This has a high impact on performance. </constant> <constant name="VIEWPORT_MSAA_8X" value="3" enum="ViewportMSAA"> - Multisample antialiasing uses 8 samples per pixel. + Multisample antialiasing uses 8 samples per pixel for 3D. This has a very high impact on performance. Likely unsupported on low-end and older hardware. </constant> - <constant name="VIEWPORT_MSAA_16X" value="4" enum="ViewportMSAA"> - Multisample antialiasing uses 16 samples per pixel. - </constant> - <constant name="VIEWPORT_MSAA_MAX" value="5" enum="ViewportMSAA"> + <constant name="VIEWPORT_MSAA_MAX" value="4" enum="ViewportMSAA"> </constant> <constant name="VIEWPORT_SCREEN_SPACE_AA_DISABLED" value="0" enum="ViewportScreenSpaceAA"> </constant> diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml index b5031cfc63..b18ca29a8c 100644 --- a/doc/classes/TileData.xml +++ b/doc/classes/TileData.xml @@ -11,6 +11,7 @@ <return type="void" /> <argument index="0" name="layer_id" type="int" /> <description> + Adds a collision polygon to the tile on the given TileSet physics layer. </description> </method> <method name="get_collision_polygon_one_way_margin" qualifiers="const"> @@ -18,6 +19,7 @@ <argument index="0" name="layer_id" type="int" /> <argument index="1" name="polygon_index" type="int" /> <description> + Returns the one-way margin (for one-way platforms) of the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code]. </description> </method> <method name="get_collision_polygon_points" qualifiers="const"> @@ -25,42 +27,49 @@ <argument index="0" name="layer_id" type="int" /> <argument index="1" name="polygon_index" type="int" /> <description> + Returns the points of the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code]. </description> </method> <method name="get_collision_polygons_count" qualifiers="const"> <return type="int" /> <argument index="0" name="layer_id" type="int" /> <description> + Returns how many polygons the tile has for TileSet physics layer with index [code]layer_id[/code]. </description> </method> <method name="get_custom_data" qualifiers="const"> <return type="Variant" /> <argument index="0" name="layer_name" type="String" /> <description> + Returns the custom data value for custom data layer named [code]layer_name[/code]. </description> </method> <method name="get_custom_data_by_layer_id" qualifiers="const"> <return type="Variant" /> <argument index="0" name="layer_id" type="int" /> <description> + Returns the custom data value for custom data layer with index [code]layer_id[/code]. </description> </method> <method name="get_navigation_polygon" qualifiers="const"> <return type="NavigationPolygon" /> <argument index="0" name="layer_id" type="int" /> <description> + Returns the navigation polygon of the tile for the TileSet navigation layer with index [code]layer_id[/code]. </description> </method> <method name="get_occluder" qualifiers="const"> <return type="OccluderPolygon2D" /> <argument index="0" name="layer_id" type="int" /> <description> + Returns the occluder polygon of the tile for the TileSet occlusion layer with index [code]layer_id[/code]. </description> </method> <method name="get_peering_bit_terrain" qualifiers="const"> <return type="int" /> <argument index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" /> <description> + Returns the tile's terrain bit for the given [code]peering_bit[/code] direction. </description> </method> <method name="is_collision_polygon_one_way" qualifiers="const"> @@ -68,6 +77,7 @@ <argument index="0" name="layer_id" type="int" /> <argument index="1" name="polygon_index" type="int" /> <description> + Returns whether one-way collisions are enabled for the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code]. </description> </method> <method name="remove_collision_polygon"> @@ -75,6 +85,7 @@ <argument index="0" name="layer_id" type="int" /> <argument index="1" name="polygon_index" type="int" /> <description> + Removes the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code]. </description> </method> <method name="set_collision_polygon_one_way"> @@ -83,6 +94,7 @@ <argument index="1" name="polygon_index" type="int" /> <argument index="2" name="one_way" type="bool" /> <description> + Enables/disables one-way collisions on the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code]. </description> </method> <method name="set_collision_polygon_one_way_margin"> @@ -91,6 +103,7 @@ <argument index="1" name="polygon_index" type="int" /> <argument index="2" name="one_way_margin" type="float" /> <description> + Enables/disables one-way collisions on the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code]. </description> </method> <method name="set_collision_polygon_points"> @@ -99,6 +112,7 @@ <argument index="1" name="polygon_index" type="int" /> <argument index="2" name="polygon" type="PackedVector2Array" /> <description> + Sets the points of the polygon at index [code]polygon_index[/code] for TileSet physics layer with index [code]layer_id[/code]. </description> </method> <method name="set_collision_polygons_count"> @@ -106,6 +120,7 @@ <argument index="0" name="layer_id" type="int" /> <argument index="1" name="polygons_count" type="int" /> <description> + Sets the polygons count for TileSet physics layer with index [code]layer_id[/code]. </description> </method> <method name="set_custom_data"> @@ -113,6 +128,7 @@ <argument index="0" name="layer_name" type="String" /> <argument index="1" name="value" type="Variant" /> <description> + Sets the tile's custom data value for the TileSet custom data layer with name [code]layer_name[/code]. </description> </method> <method name="set_custom_data_by_layer_id"> @@ -120,6 +136,7 @@ <argument index="0" name="layer_id" type="int" /> <argument index="1" name="value" type="Variant" /> <description> + Sets the tile's custom data value for the TileSet custom data layer with index [code]layer_id[/code]. </description> </method> <method name="set_navigation_polygon"> @@ -127,6 +144,7 @@ <argument index="0" name="layer_id" type="int" /> <argument index="1" name="navigation_polygon" type="NavigationPolygon" /> <description> + Sets the navigation polygon for the TileSet navigation layer with index [code]layer_id[/code]. </description> </method> <method name="set_occluder"> @@ -134,6 +152,7 @@ <argument index="0" name="layer_id" type="int" /> <argument index="1" name="occluder_polygon" type="OccluderPolygon2D" /> <description> + Sets the occluder for the TileSet occlusion layer with index [code]layer_id[/code]. </description> </method> <method name="set_peering_bit_terrain"> @@ -141,17 +160,7 @@ <argument index="0" name="peering_bit" type="int" enum="TileSet.CellNeighbor" /> <argument index="1" name="terrain" type="int" /> <description> - </description> - </method> - <method name="tile_get_material" qualifiers="const"> - <return type="ShaderMaterial" /> - <description> - </description> - </method> - <method name="tile_set_material"> - <return type="void" /> - <argument index="0" name="material" type="ShaderMaterial" /> - <description> + Sets the tile's terrain bit for the given [code]peering_bit[/code] direction. </description> </method> </methods> @@ -160,6 +169,8 @@ </member> <member name="flip_v" type="bool" setter="set_flip_v" getter="get_flip_v" default="false"> </member> + <member name="material" type="ShaderMaterial" setter="set_material" getter="get_material"> + </member> <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> </member> <member name="probability" type="float" setter="set_probability" getter="get_probability" default="1.0"> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index e92a7331e6..4621d138ac 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -4,8 +4,7 @@ Node for 2D tile-based maps. </brief_description> <description> - Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps. - When doing physics queries against the tilemap, the cell coordinates are encoded as [code]metadata[/code] for each detected collision shape returned by methods such as [method PhysicsDirectSpaceState2D.intersect_shape], [method PhysicsDirectBodyState2D.get_contact_collider_shape_metadata] etc. + Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles which are used to create grid-based maps. A TileMap may have several layers, layouting tiles on top of each other. </description> <tutorials> <link title="Using Tilemaps">https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link> @@ -19,8 +18,9 @@ <methods> <method name="add_layer"> <return type="void" /> - <argument index="0" name="arg0" type="int" /> + <argument index="0" name="to_position" type="int" /> <description> + Adds a layer at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array. </description> </method> <method name="clear"> @@ -41,6 +41,7 @@ <argument index="1" name="coords" type="Vector2i" /> <argument index="2" name="use_proxies" type="bool" /> <description> + Returns the tile alternative ID of the cell on layer [code]layer[/code] at [code]coords[/code]. If [code]use_proxies[/code] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy]. </description> </method> <method name="get_cell_atlas_coords" qualifiers="const"> @@ -49,6 +50,7 @@ <argument index="1" name="coords" type="Vector2i" /> <argument index="2" name="use_proxies" type="bool" /> <description> + Returns the tile atlas coordinates ID of the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. If [code]use_proxies[/code] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy]. </description> </method> <method name="get_cell_source_id" qualifiers="const"> @@ -57,24 +59,28 @@ <argument index="1" name="coords" type="Vector2i" /> <argument index="2" name="use_proxies" type="bool" /> <description> + Returns the tile source ID of the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. If [code]use_proxies[/code] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy]. </description> </method> <method name="get_layer_name" qualifiers="const"> <return type="String" /> <argument index="0" name="layer" type="int" /> <description> + Returns a TileMap layer's name. </description> </method> <method name="get_layer_y_sort_origin" qualifiers="const"> <return type="int" /> <argument index="0" name="layer" type="int" /> <description> + Returns a TileMap layer's Y sort origin. </description> </method> - <method name="get_layer_z_indexd" qualifiers="const"> + <method name="get_layer_z_index" qualifiers="const"> <return type="int" /> <argument index="0" name="layer" type="int" /> <description> + Returns a TileMap layer's Z-index value. </description> </method> <method name="get_layers_count" qualifiers="const"> @@ -87,37 +93,41 @@ <argument index="0" name="coords" type="Vector2i" /> <argument index="1" name="neighbor" type="int" enum="TileSet.CellNeighbor" /> <description> + Returns the neighboring cell to the one at coordinates [code]coords[/code], indentified by the [code]neighbor[/code] direction. This method takes into account the different layouts a TileMap can take. </description> </method> <method name="get_surrounding_tiles"> <return type="Vector2i[]" /> <argument index="0" name="coords" type="Vector2i" /> <description> + Returns the list of all neighbourings cells to the one at [code]coords[/code] </description> </method> <method name="get_used_cells" qualifiers="const"> <return type="Vector2i[]" /> <argument index="0" name="layer" type="int" /> <description> - Returns a [Vector2] array with the positions of all cells containing a tile from the tileset (i.e. a tile index different from [code]-1[/code]). + Returns a [Vector2] array with the positions of all cells containing a tile in the given layer. A cell is considered empty if its source identifier equals -1, its atlas coordinates identifiers is [code]Vector2(-1, -1)[/code] and its alternative identifier is -1. </description> </method> <method name="get_used_rect"> <return type="Rect2" /> <description> - Returns a rectangle enclosing the used (non-empty) tiles of the map. + Returns a rectangle enclosing the used (non-empty) tiles of the map, including all layers. </description> </method> <method name="is_layer_enabled" qualifiers="const"> <return type="bool" /> <argument index="0" name="layer" type="int" /> <description> + Returns if a layer is enabled. </description> </method> <method name="is_layer_y_sort_enabled" qualifiers="const"> <return type="bool" /> <argument index="0" name="layer" type="int" /> <description> + Returns if a layer Y-sorts its tiles. </description> </method> <method name="map_to_world" qualifiers="const"> @@ -129,15 +139,17 @@ </method> <method name="move_layer"> <return type="void" /> - <argument index="0" name="arg0" type="int" /> - <argument index="1" name="arg1" type="int" /> + <argument index="0" name="layer" type="int" /> + <argument index="1" name="to_position" type="int" /> <description> + Moves the layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array. </description> </method> <method name="remove_layer"> <return type="void" /> - <argument index="0" name="arg0" type="int" /> + <argument index="0" name="layer" type="int" /> <description> + Moves the layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array. </description> </method> <method name="set_cell"> @@ -148,7 +160,10 @@ <argument index="3" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" /> <argument index="4" name="alternative_tile" type="int" default="-1" /> <description> - Sets the tile index for the cell given by a Vector2i. + Sets the tile indentifiers for the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. Each tile of the [TileSet] is identified using three parts: + - The source indentifier [code]source_id[/code] identifies a [TileSetSource] identifier. See [method TileSet.set_source_id], + - The atlas coordinates identifier [code]atlas_coords[/code] identifies a tile coordinates in the atlas (if the source is a [TileSetAtlasSource]. For [TileSetScenesCollectionSource] it should be 0), + - The alternative tile identifier [code]alternative_tile[/code] identifies a tile alternative the source is a [TileSetAtlasSource], and the scene for a [TileSetScenesCollectionSource]. </description> </method> <method name="set_layer_enabled"> @@ -156,6 +171,7 @@ <argument index="0" name="layer" type="int" /> <argument index="1" name="enabled" type="bool" /> <description> + Enables or disables the layer [code]layer[/code]. A disabled layer is not processed at all (no rendering, no physics, etc...). </description> </method> <method name="set_layer_name"> @@ -163,6 +179,7 @@ <argument index="0" name="layer" type="int" /> <argument index="1" name="name" type="String" /> <description> + Sets a layer's name. This is mostly useful in the editor. </description> </method> <method name="set_layer_y_sort_enabled"> @@ -170,6 +187,8 @@ <argument index="0" name="layer" type="int" /> <argument index="1" name="y_sort_enabled" type="bool" /> <description> + Enables or disables a layer's Y-sorting. If a layer is Y-sorted, the layer will behave as a CanvasItem node where each of its tile gets Y-sorted. + Y-sorted layers should usually be on different Z-index values than not Y-sorted layers, otherwise, each of those layer will be Y-sorted as whole with the Y-sorted one. This is usually an undesired behvaior. </description> </method> <method name="set_layer_y_sort_origin"> @@ -177,6 +196,8 @@ <argument index="0" name="layer" type="int" /> <argument index="1" name="y_sort_origin" type="int" /> <description> + Sets a layer's Y-sort origin value. This Y-sort origin value is added to each tile's Y-sort origin value. + This allows, for example, to fake a different height level on each layer. This can be useful for top-down view games. </description> </method> <method name="set_layer_z_index"> @@ -184,6 +205,7 @@ <argument index="0" name="layer" type="int" /> <argument index="1" name="z_index" type="int" /> <description> + Sets a layers Z-index value. This Z-index is added to each tile's Z-index value. </description> </method> <method name="world_to_map" qualifiers="const"> @@ -199,8 +221,10 @@ The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. </member> <member name="collision_visibility_mode" type="int" setter="set_collision_visibility_mode" getter="get_collision_visibility_mode" enum="TileMap.VisibilityMode" default="0"> + Show or hide the TileMap's collision shapes. If set to [code]VISIBILITY_MODE_DEFAULT[/code], this depends on the show collision debug settings. </member> <member name="navigation_visibility_mode" type="int" setter="set_navigation_visibility_mode" getter="get_navigation_visibility_mode" enum="TileMap.VisibilityMode" default="0"> + Show or hide the TileMap's collision shapes. If set to [code]VISIBILITY_MODE_DEFAULT[/code], this depends on the show navigation debug settings. </member> <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset"> The assigned [TileSet]. @@ -215,10 +239,13 @@ </signals> <constants> <constant name="VISIBILITY_MODE_DEFAULT" value="0" enum="VisibilityMode"> + Use the debug settings to determine visibility. </constant> <constant name="VISIBILITY_MODE_FORCE_HIDE" value="2" enum="VisibilityMode"> + Always hide. </constant> <constant name="VISIBILITY_MODE_FORCE_SHOW" value="1" enum="VisibilityMode"> + Always show. </constant> </constants> </class> diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 3e0ab87383..02baded019 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -4,8 +4,13 @@ Tile library for tilemaps. </brief_description> <description> - A TileSet is a library of tiles for a [TileMap]. It contains a list of tiles, each consisting of a sprite and optional collision shapes. - Tiles are referenced by a unique integer ID. + A TileSet is a library of tiles for a [TileMap]. A TileSet handles a list of [TileSetSource], each of them storing a set of tiles. + Tiles can either be from a [TileSetAtlasSource], that render tiles out of a texture with support for physics, navigation, etc... or from a [TileSetScenesCollectionSource] which exposes scene-based tiles. + Tiles are referenced by using three IDs: their source ID, their atlas coordinates ID and their alternative tile ID. + + A TileSet can be configured so that its tiles expose more or less properties. To do so, the TileSet resources uses property layers, that you can add or remove depending on your needs. + For example, adding a physics layer allows giving collision shapes to your tiles. Each layer having dedicated properties (physics layer an mask), you may add several TileSet physics layers for each type of collision you need. + See the functions to add new layers for more information. </description> <tutorials> <link title="Using Tilemaps">https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link> @@ -21,31 +26,41 @@ <return type="void" /> <argument index="0" name="to_position" type="int" default="-1" /> <description> + Adds a custom data layer to the TileSet at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array. + Custom data layers allow assigning custom properties to atlas tiles. </description> </method> <method name="add_navigation_layer"> <return type="void" /> <argument index="0" name="to_position" type="int" default="-1" /> <description> + Adds a navigation layer to the TileSet at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array. + Navigation layers allow assigning a navigable area to atlas tiles. </description> </method> <method name="add_occlusion_layer"> <return type="void" /> <argument index="0" name="to_position" type="int" default="-1" /> <description> + Adds an occlusion layer to the TileSet at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array. + Occlusion layers allow assigning occlusion polygons to atlas tiles. </description> </method> <method name="add_physics_layer"> <return type="void" /> <argument index="0" name="to_position" type="int" default="-1" /> <description> + Adds a physics layer to the TileSet at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array. + Physics layers allow assigning collision polygons to atlas tiles. </description> </method> <method name="add_source"> <return type="int" /> - <argument index="0" name="atlas_source_id_override" type="TileSetSource" /> - <argument index="1" name="arg1" type="int" default="-1" /> + <argument index="0" name="source" type="TileSetSource" /> + <argument index="1" name="atlas_source_id_override" type="int" default="-1" /> <description> + Adds a [TileSetSource] to the TileSet. If [code]atlas_source_id_override[/code] is not -1, also set its source ID. Otherwise, a unique identifier is automatically generated. + The function returns the added source source ID or -1 if the source could not be added. </description> </method> <method name="add_terrain"> @@ -53,22 +68,26 @@ <argument index="0" name="terrain_set" type="int" /> <argument index="1" name="to_position" type="int" default="-1" /> <description> + Adds a new terrain to the given terrain set [code]terrain_set[/code] at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array. </description> </method> <method name="add_terrain_set"> <return type="void" /> <argument index="0" name="to_position" type="int" default="-1" /> <description> + Adds a new terrain set at the given position [code]to_position[/code] in the array. If [code]to_position[/code] is -1, adds it at the end of the array. </description> </method> <method name="cleanup_invalid_tile_proxies"> <return type="void" /> <description> + Clears tile proxies pointing to invalid tiles. </description> </method> <method name="clear_tile_proxies"> <return type="void" /> <description> + Clears all tile proxies. </description> </method> <method name="get_alternative_level_tile_proxy"> @@ -77,6 +96,8 @@ <argument index="1" name="coords_from" type="Vector2i" /> <argument index="2" name="alternative_from" type="int" /> <description> + Returns the alternative-level proxy for the given identifiers. The returned array contains the three proxie's target identifiers (source ID, atlas coords ID and alternative tile ID). + If the TileSet has no proxy for the given identifiers, returns an empty Array. </description> </method> <method name="get_coords_level_tile_proxy"> @@ -84,90 +105,108 @@ <argument index="0" name="source_from" type="int" /> <argument index="1" name="coords_from" type="Vector2i" /> <description> + Returns the coodinate-level proxy for the given identifiers. The returned array contains the two proxie's target identifiers (source ID and atlas coords ID). + If the TileSet has no proxy for the given identifiers, returns an empty Array. </description> </method> <method name="get_custom_data_layers_count" qualifiers="const"> <return type="int" /> <description> + Returns the custom data layers count. </description> </method> <method name="get_navigation_layer_layers" qualifiers="const"> <return type="int" /> <argument index="0" name="layer_index" type="int" /> <description> + Returns the navigation layers (as in the Navigation server) of the gives TileSet navigation layer. </description> </method> <method name="get_navigation_layers_count" qualifiers="const"> <return type="int" /> <description> + Returns the navigation layers count. </description> </method> <method name="get_next_source_id" qualifiers="const"> <return type="int" /> <description> + Returns a new unused source ID. This generated ID is the same that a call to [code]add_source[/code] would return. </description> </method> <method name="get_occlusion_layer_light_mask" qualifiers="const"> <return type="int" /> - <argument index="0" name="arg0" type="int" /> + <argument index="0" name="layer_index" type="int" /> <description> + Returns the light mask of the occlusion layer. </description> </method> <method name="get_occlusion_layer_sdf_collision" qualifiers="const"> <return type="bool" /> - <argument index="0" name="arg0" type="int" /> + <argument index="0" name="layer_index" type="int" /> <description> + Returns if the occluders from this layer use [code]sdf_collision[/code]. </description> </method> <method name="get_occlusion_layers_count" qualifiers="const"> <return type="int" /> <description> + Returns the occlusion layers count. </description> </method> <method name="get_physics_layer_collision_layer" qualifiers="const"> <return type="int" /> <argument index="0" name="layer_index" type="int" /> <description> + Returns the collision layer (as in the physics server) bodies on the given TileSet's physics layer are in. </description> </method> <method name="get_physics_layer_collision_mask" qualifiers="const"> <return type="int" /> <argument index="0" name="layer_index" type="int" /> <description> + Returns the collision mask of bodies on the given TileSet's physics layer. </description> </method> <method name="get_physics_layer_physics_material" qualifiers="const"> <return type="PhysicsMaterial" /> <argument index="0" name="layer_index" type="int" /> <description> + Returns the physics material of bodies on the given TileSet's physics layer. </description> </method> <method name="get_physics_layers_count" qualifiers="const"> <return type="int" /> <description> + Returns the physics layers count. </description> </method> <method name="get_source" qualifiers="const"> <return type="TileSetSource" /> - <argument index="0" name="index" type="int" /> + <argument index="0" name="source_id" type="int" /> <description> + Returns the [TileSetSource] with ID [code]source_id[/code]. </description> </method> <method name="get_source_count" qualifiers="const"> <return type="int" /> <description> + Returns the number of [TileSetSource] in this TileSet. </description> </method> <method name="get_source_id" qualifiers="const"> <return type="int" /> <argument index="0" name="index" type="int" /> <description> + Returns the source ID for source with index [code]index[/code]. </description> </method> <method name="get_source_level_tile_proxy"> <return type="int" /> <argument index="0" name="source_from" type="int" /> <description> + Returns the source-level proxy for the given source identifier. + If the TileSet has no proxy for the given identifier, returns -1. </description> </method> <method name="get_terrain_color" qualifiers="const"> @@ -175,6 +214,7 @@ <argument index="0" name="terrain_set" type="int" /> <argument index="1" name="terrain_index" type="int" /> <description> + Returns a terrain's color. </description> </method> <method name="get_terrain_name" qualifiers="const"> @@ -182,23 +222,27 @@ <argument index="0" name="terrain_set" type="int" /> <argument index="1" name="terrain_index" type="int" /> <description> + Returns a terrain's name. </description> </method> <method name="get_terrain_set_mode" qualifiers="const"> <return type="int" enum="TileSet.TerrainMode" /> <argument index="0" name="terrain_set" type="int" /> <description> + Returns a terrain set mode. </description> </method> <method name="get_terrain_sets_count" qualifiers="const"> <return type="int" /> <description> + Returns the terrain sets count. </description> </method> <method name="get_terrains_count" qualifiers="const"> <return type="int" /> <argument index="0" name="terrain_set" type="int" /> <description> + Returns the number of terrains in the given terrain set. </description> </method> <method name="has_alternative_level_tile_proxy"> @@ -207,6 +251,7 @@ <argument index="1" name="coords_from" type="Vector2i" /> <argument index="2" name="alternative_from" type="int" /> <description> + Returns if there is and alternative-level proxy for the given identifiers. </description> </method> <method name="has_coords_level_tile_proxy"> @@ -214,18 +259,21 @@ <argument index="0" name="source_from" type="int" /> <argument index="1" name="coords_from" type="Vector2i" /> <description> + Returns if there is a coodinates-level proxy for the given identifiers. </description> </method> <method name="has_source" qualifiers="const"> <return type="bool" /> - <argument index="0" name="index" type="int" /> + <argument index="0" name="source_id" type="int" /> <description> + Returns if this TileSet has a source for the given source ID. </description> </method> <method name="has_source_level_tile_proxy"> <return type="bool" /> <argument index="0" name="source_from" type="int" /> <description> + Returns if there is a source-level proxy for the given source ID. </description> </method> <method name="map_tile_proxy" qualifiers="const"> @@ -234,6 +282,9 @@ <argument index="1" name="coords_from" type="Vector2i" /> <argument index="2" name="alternative_from" type="int" /> <description> + According to the configured proxies, maps the provided indentifiers to a new set of identifiers. The source ID, atlas coordinates ID and alternative tile ID are returned as a 3 elements Array. + This function first look for matching alternative-level proxies, then coordinates-level proxies, then source-level proxies. + If no proxy corresponding to provided identifiers are found, returns the same values the ones used as arguments. </description> </method> <method name="move_custom_data_layer"> @@ -241,6 +292,7 @@ <argument index="0" name="layer_index" type="int" /> <argument index="1" name="to_position" type="int" /> <description> + Moves the custom data layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly. </description> </method> <method name="move_navigation_layer"> @@ -248,6 +300,7 @@ <argument index="0" name="layer_index" type="int" /> <argument index="1" name="to_position" type="int" /> <description> + Moves the navigation layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly. </description> </method> <method name="move_occlusion_layer"> @@ -255,6 +308,7 @@ <argument index="0" name="layer_index" type="int" /> <argument index="1" name="to_position" type="int" /> <description> + Moves the occlusion layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly. </description> </method> <method name="move_physics_layer"> @@ -262,6 +316,7 @@ <argument index="0" name="layer_index" type="int" /> <argument index="1" name="to_position" type="int" /> <description> + Moves the physics layer at index [code]layer_index[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly. </description> </method> <method name="move_terrain"> @@ -270,13 +325,15 @@ <argument index="1" name="terrain_index" type="int" /> <argument index="2" name="to_position" type="int" /> <description> + Moves the terrain at index [code]terrain_index[/code] for terrain set [code]terrain_set[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly. </description> </method> <method name="move_terrain_set"> <return type="void" /> - <argument index="0" name="layer_index" type="int" /> + <argument index="0" name="terrain_set" type="int" /> <argument index="1" name="to_position" type="int" /> <description> + Moves the terrain set at index [code]terrain_set[/code] to the given position [code]to_position[/code] in the array. Also updates the atlas tiles accordingly. </description> </method> <method name="remove_alternative_level_tile_proxy"> @@ -285,6 +342,7 @@ <argument index="1" name="coords_from" type="Vector2i" /> <argument index="2" name="alternative_from" type="int" /> <description> + Removes an alternative-level proxy for the given identifiers. </description> </method> <method name="remove_coords_level_tile_proxy"> @@ -292,42 +350,49 @@ <argument index="0" name="source_from" type="int" /> <argument index="1" name="coords_from" type="Vector2i" /> <description> + Removes a coordinates-level proxy for the given identifiers. </description> </method> <method name="remove_custom_data_layer"> <return type="void" /> <argument index="0" name="layer_index" type="int" /> <description> + Removes the custom data layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly. </description> </method> <method name="remove_navigation_layer"> <return type="void" /> <argument index="0" name="layer_index" type="int" /> <description> + Removes the navigation layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly. </description> </method> <method name="remove_occlusion_layer"> <return type="void" /> <argument index="0" name="layer_index" type="int" /> <description> + Removes the occlusion layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly. </description> </method> <method name="remove_physics_layer"> <return type="void" /> <argument index="0" name="layer_index" type="int" /> <description> + Removes the physics layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly. </description> </method> <method name="remove_source"> <return type="void" /> <argument index="0" name="source_id" type="int" /> <description> + Removes the source with the given source ID. </description> </method> <method name="remove_source_level_tile_proxy"> <return type="void" /> <argument index="0" name="source_from" type="int" /> <description> + Removes a source-level tile proxy. </description> </method> <method name="remove_terrain"> @@ -335,12 +400,14 @@ <argument index="0" name="terrain_set" type="int" /> <argument index="1" name="terrain_index" type="int" /> <description> + Removes the terrain at index [code]terrain_index[/code] in the given terrain set [code]terrain_set[/code]. Also updates the atlas tiles accordingly. </description> </method> <method name="remove_terrain_set"> <return type="void" /> - <argument index="0" name="layer_index" type="int" /> + <argument index="0" name="terrain_set" type="int" /> <description> + Removes the terrain set at index [code]terrain_set[/code]. Also updates the atlas tiles accordingly. </description> </method> <method name="set_alternative_level_tile_proxy"> @@ -352,6 +419,9 @@ <argument index="4" name="coords_to" type="Vector2i" /> <argument index="5" name="alternative_to" type="int" /> <description> + Create an alternative-level proxy for the given identifiers. A proxy will map set of tile identifiers to another set of identifiers. + This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target tile when one is available. + Proxied tiles can be automatically replaced in TileMap nodes using the editor. </description> </method> <method name="set_coords_level_tile_proxy"> @@ -361,6 +431,9 @@ <argument index="2" name="source_to" type="int" /> <argument index="3" name="coords_to" type="Vector2i" /> <description> + Creates a coordinates-level proxy for the given identifiers. A proxy will map set of tile identifiers to another set of identifiers. The alternative tile ID is kept the same when using coordinates-level proxies. + This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target tile when one is available. + Proxied tiles can be automatically replaced in TileMap nodes using the editor. </description> </method> <method name="set_navigation_layer_layers"> @@ -368,6 +441,7 @@ <argument index="0" name="layer_index" type="int" /> <argument index="1" name="layers" type="int" /> <description> + Sets the navigation layers (as in the navigation server) for navigation regions is the given TileSet navigation layer. </description> </method> <method name="set_occlusion_layer_light_mask"> @@ -375,13 +449,15 @@ <argument index="0" name="layer_index" type="int" /> <argument index="1" name="light_mask" type="int" /> <description> + Sets the occlusion layer (as in the rendering server) for occluders in the given TileSet occlusion layer. </description> </method> <method name="set_occlusion_layer_sdf_collision"> <return type="void" /> <argument index="0" name="layer_index" type="int" /> - <argument index="1" name="sdf_collision" type="int" /> + <argument index="1" name="sdf_collision" type="bool" /> <description> + Enables or disables sdf collision for occluders in the given TileSet occlusion layer. </description> </method> <method name="set_physics_layer_collision_layer"> @@ -389,6 +465,7 @@ <argument index="0" name="layer_index" type="int" /> <argument index="1" name="layer" type="int" /> <description> + Sets the physics layer (as in the physics server) for bodies in the given TileSet physics layer. </description> </method> <method name="set_physics_layer_collision_mask"> @@ -396,6 +473,7 @@ <argument index="0" name="layer_index" type="int" /> <argument index="1" name="mask" type="int" /> <description> + Sets the physics layer (as in the physics server) for bodies in the given TileSet physics layer. </description> </method> <method name="set_physics_layer_physics_material"> @@ -403,13 +481,15 @@ <argument index="0" name="layer_index" type="int" /> <argument index="1" name="physics_material" type="PhysicsMaterial" /> <description> + Sets the physics material for bodies in the given TileSet physics layer. </description> </method> <method name="set_source_id"> <return type="void" /> <argument index="0" name="source_id" type="int" /> - <argument index="1" name="arg1" type="int" /> + <argument index="1" name="new_source_id" type="int" /> <description> + Changes a source's ID. </description> </method> <method name="set_source_level_tile_proxy"> @@ -417,6 +497,9 @@ <argument index="0" name="source_from" type="int" /> <argument index="1" name="source_to" type="int" /> <description> + Creates a source-level proxy for the given source ID. A proxy will map set of tile identifiers to another set of identifiers. Both the atlac coordinates ID and the alternative tile ID are kept the same when using source-level proxies. + This can be used to replace a source in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target source when one is available. + Proxied tiles can be automatically replaced in TileMap nodes using the editor. </description> </method> <method name="set_terrain_color"> @@ -425,6 +508,7 @@ <argument index="1" name="terrain_index" type="int" /> <argument index="2" name="color" type="Color" /> <description> + Sets a terrain's color. This color is used for identifying the different terrains in the TileSet editor. </description> </method> <method name="set_terrain_name"> @@ -433,6 +517,7 @@ <argument index="1" name="terrain_index" type="int" /> <argument index="2" name="name" type="String" /> <description> + Sets a terrain's name. </description> </method> <method name="set_terrain_set_mode"> @@ -440,86 +525,120 @@ <argument index="0" name="terrain_set" type="int" /> <argument index="1" name="mode" type="int" enum="TileSet.TerrainMode" /> <description> + Sets a terrain mode. Each mode determines which bits of a tile shape is used to match the neighbouring tiles' terrains. </description> </method> </methods> <members> <member name="tile_layout" type="int" setter="set_tile_layout" getter="get_tile_layout" enum="TileSet.TileLayout" default="0"> + For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), changes the way tiles are indexed in the TileMap grid. </member> <member name="tile_offset_axis" type="int" setter="set_tile_offset_axis" getter="get_tile_offset_axis" enum="TileSet.TileOffsetAxis" default="0"> + For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), determines the offset axis. </member> <member name="tile_shape" type="int" setter="set_tile_shape" getter="get_tile_shape" enum="TileSet.TileShape" default="0"> + The tile shape. </member> <member name="tile_size" type="Vector2i" setter="set_tile_size" getter="get_tile_size" default="Vector2i(16, 16)"> + The tile size, in pixels. For all tile shapes, this size corresponds to the encompassing rectangle of the tile shape. This is thus the minimal cell size required in an atlas. </member> <member name="uv_clipping" type="bool" setter="set_uv_clipping" getter="is_uv_clipping" default="false"> + Enables/Disable uv clipping when rendering the tiles. </member> </members> <constants> <constant name="TILE_SHAPE_SQUARE" value="0" enum="TileShape"> - Orthogonal orientation mode. + Rectangular tile shape. </constant> <constant name="TILE_SHAPE_ISOMETRIC" value="1" enum="TileShape"> - Isometric orientation mode. + Diamond tile shape (for isometric look). </constant> <constant name="TILE_SHAPE_HALF_OFFSET_SQUARE" value="2" enum="TileShape"> + Rectangular tile shape with one row/colum out of two offset by half a tile. </constant> <constant name="TILE_SHAPE_HEXAGON" value="3" enum="TileShape"> - Hexagon orientation mode. + Hexagonal tile shape. </constant> <constant name="TILE_LAYOUT_STACKED" value="0" enum="TileLayout"> + Tile coordinates layout where both axis stay consistent with their respective local horizontal and vertical axis. </constant> <constant name="TILE_LAYOUT_STACKED_OFFSET" value="1" enum="TileLayout"> + Same as [code]TILE_LAYOUT_STAKED[/code], but the first half-offset is negative instead of positive. </constant> <constant name="TILE_LAYOUT_STAIRS_RIGHT" value="2" enum="TileLayout"> + Tile coordinates layout where the horizontal axis stay horizontal, and the vertical one goes down-right. </constant> <constant name="TILE_LAYOUT_STAIRS_DOWN" value="3" enum="TileLayout"> + Tile coordinates layout where the vertical axis stay vertical, and the horizontal one goes down-right. </constant> <constant name="TILE_LAYOUT_DIAMOND_RIGHT" value="4" enum="TileLayout"> + Tile coordinates layout where the horizontal axis goes up-right, and the vertical one goes down-right. </constant> <constant name="TILE_LAYOUT_DIAMOND_DOWN" value="5" enum="TileLayout"> + Tile coordinates layout where the horizontal axis goes down-right, and the vertical one goes down-left. </constant> <constant name="TILE_OFFSET_AXIS_HORIZONTAL" value="0" enum="TileOffsetAxis"> + Horizontal half-offset. </constant> <constant name="TILE_OFFSET_AXIS_VERTICAL" value="1" enum="TileOffsetAxis"> + Vertical half-offset. </constant> <constant name="CELL_NEIGHBOR_RIGHT_SIDE" value="0" enum="CellNeighbor"> + Neighbor on the right side. </constant> <constant name="CELL_NEIGHBOR_RIGHT_CORNER" value="1" enum="CellNeighbor"> + Neighbor in the right corner. </constant> <constant name="CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE" value="2" enum="CellNeighbor"> + Neighbor on the bottom right side. </constant> <constant name="CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER" value="3" enum="CellNeighbor"> + Neighbor in the bottom right corner. </constant> <constant name="CELL_NEIGHBOR_BOTTOM_SIDE" value="4" enum="CellNeighbor"> + Neighbor on the bottom side. </constant> <constant name="CELL_NEIGHBOR_BOTTOM_CORNER" value="5" enum="CellNeighbor"> + Neighbor in the bottom corner. </constant> <constant name="CELL_NEIGHBOR_BOTTOM_LEFT_SIDE" value="6" enum="CellNeighbor"> + Neighbor on the bottom left side. </constant> <constant name="CELL_NEIGHBOR_BOTTOM_LEFT_CORNER" value="7" enum="CellNeighbor"> + Neighbor in the bottom left corner. </constant> <constant name="CELL_NEIGHBOR_LEFT_SIDE" value="8" enum="CellNeighbor"> + Neighbor on the left side. </constant> <constant name="CELL_NEIGHBOR_LEFT_CORNER" value="9" enum="CellNeighbor"> + Neighbor in the left corner. </constant> <constant name="CELL_NEIGHBOR_TOP_LEFT_SIDE" value="10" enum="CellNeighbor"> + Neighbor on the top left side. </constant> <constant name="CELL_NEIGHBOR_TOP_LEFT_CORNER" value="11" enum="CellNeighbor"> + Neighbor in the top left corner. </constant> <constant name="CELL_NEIGHBOR_TOP_SIDE" value="12" enum="CellNeighbor"> + Neighbor on the top side. </constant> <constant name="CELL_NEIGHBOR_TOP_CORNER" value="13" enum="CellNeighbor"> + Neighbor in the top corner. </constant> <constant name="CELL_NEIGHBOR_TOP_RIGHT_SIDE" value="14" enum="CellNeighbor"> + Neighbor on the top right side. </constant> <constant name="CELL_NEIGHBOR_TOP_RIGHT_CORNER" value="15" enum="CellNeighbor"> + Neighbor in the top right corner. </constant> <constant name="TERRAIN_MODE_MATCH_CORNERS_AND_SIDES" value="0" enum="TerrainMode"> + Requires both corners and side to match with neighboring tiles' terrains. </constant> <constant name="TERRAIN_MODE_MATCH_CORNERS" value="1" enum="TerrainMode"> + Requires corners to match with neighboring tiles' terrains. </constant> <constant name="TERRAIN_MODE_MATCH_SIDES" value="2" enum="TerrainMode"> + Requires sides to match with neighboring tiles' terrains. </constant> </constants> </class> diff --git a/doc/classes/TileSetAtlasSource.xml b/doc/classes/TileSetAtlasSource.xml index 8caa3a7c39..fd3dbd1e4d 100644 --- a/doc/classes/TileSetAtlasSource.xml +++ b/doc/classes/TileSetAtlasSource.xml @@ -1,8 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="TileSetAtlasSource" inherits="TileSetSource" version="4.0"> <brief_description> + Exposes a 2D atlas texture as a set of tiles for a [TileSet] resource. </brief_description> <description> + An atlas is a grid of tiles laid out on a texture. Each tile in the grid must be exposed using [method create_tile]. Those tiles are then indexed using their coordinates in the grid. + Each tile can also have a size in the grid coordinates, making it more or less cells in the atlas. + + Alternatives version of a tile can be created using [method create_alternative_tile], which are then indexed using an alternative ID. The main tile (the one in the grid), is accessed with an alternative ID equal to 0. + + Each tile alternate has a set of properties that is defined by the source's [TileSet] layers. Those properties are stored in a TileData object that can be accessed and modified using [method get_tile_data]. + As TileData properties are stored directly in the TileSetAtlasSource resource, their properties might also be set using [code]TileSetAtlasSource.set("<coords_x>:<coords_y>/<alternative_id>/<tile_data_property>")[/code]. </description> <tutorials> </tutorials> @@ -13,11 +21,14 @@ <argument index="1" name="new_atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" /> <argument index="2" name="new_size" type="Vector2i" default="Vector2i(-1, -1)" /> <description> + Returns true if the tile at the [code]atlas_coords[/code] coordinates can be moved to the [code]new_atlas_coords[/code] coordinates with the [code]new_size[/code] size. This functions returns false if a tile is already present in the given area, or if this area is outside the atlas boundaries. + If [code]new_atlas_coords[/code] is [code]Vector2i(-1, -1)[/code], keeps the tile's coordinates. If [code]new_size[/code] is [code]Vector2i(-1, -1)[/code], keeps the tile's size. </description> </method> <method name="clear_tiles_outside_texture"> <return type="void" /> <description> + Clears all tiles that are defined outside the texture boundaries. </description> </method> <method name="create_alternative_tile"> @@ -25,6 +36,8 @@ <argument index="0" name="atlas_coords" type="Vector2i" /> <argument index="1" name="alternative_id_override" type="int" default="-1" /> <description> + Creates an alternative tile for the tile at coords [code]atlas_coords[/code]. If [code]alternative_id_override[/code] is -1, give it an automatically generated unique ID, or assigns it the given ID otherwise. + Returns the new alternative identifier, or -1 if the alternative could not be created with a provided [code]alternative_id_override[/code]. </description> </method> <method name="create_tile"> @@ -32,84 +45,55 @@ <argument index="0" name="atlas_coords" type="Vector2i" /> <argument index="1" name="size" type="Vector2i" default="Vector2i(1, 1)" /> <description> - </description> - </method> - <method name="get_alternative_tile_id" qualifiers="const"> - <return type="int" /> - <argument index="0" name="atlas_coords" type="Vector2i" /> - <argument index="1" name="index" type="int" /> - <description> - </description> - </method> - <method name="get_alternative_tiles_count" qualifiers="const"> - <return type="int" /> - <argument index="0" name="atlas_coords" type="Vector2i" /> - <description> + Creates a new tile at coords [code]atlas_coords[/code] with size [code]size[/code]. </description> </method> <method name="get_atlas_grid_size" qualifiers="const"> <return type="Vector2i" /> <description> + Returns the atlas grid size, which depends on how many tiles can fit in the texture. It thus depends on the Texture's size, the atlas [code]margins[/code] the tiles' [code]texture_region_size[/code]. </description> </method> <method name="get_next_alternative_tile_id" qualifiers="const"> <return type="int" /> <argument index="0" name="atlas_coords" type="Vector2i" /> <description> + Returns the alternative ID a following call to [method create_alternative_tile] would return. </description> </method> <method name="get_tile_at_coords" qualifiers="const"> <return type="Vector2i" /> <argument index="0" name="atlas_coords" type="Vector2i" /> <description> + If there is a tile covering the [code]atlas_coords[/code] coordinates, returns the top-left coordinates of the tile (thus its coordinate ID). Returns [code]Vector2i(-1, -1)[/code] otherwise. </description> </method> <method name="get_tile_data" qualifiers="const"> <return type="Object" /> <argument index="0" name="atlas_coords" type="Vector2i" /> - <argument index="1" name="index" type="int" /> - <description> - </description> - </method> - <method name="get_tile_id" qualifiers="const"> - <return type="Vector2i" /> - <argument index="0" name="index" type="int" /> + <argument index="1" name="alternative_tile" type="int" /> <description> + Returns the [TileData] object for the given atlas coordinates and alternative ID. </description> </method> <method name="get_tile_size_in_atlas" qualifiers="const"> <return type="Vector2i" /> <argument index="0" name="atlas_coords" type="Vector2i" /> <description> + Returns the size of the tile (in the grid coordinates system) at coordinates [code]atlas_coords[/code]. </description> </method> <method name="get_tile_texture_region" qualifiers="const"> <return type="Rect2i" /> <argument index="0" name="atlas_coords" type="Vector2i" /> <description> - </description> - </method> - <method name="get_tiles_count" qualifiers="const"> - <return type="int" /> - <description> - </description> - </method> - <method name="has_alternative_tile" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="atlas_coords" type="Vector2i" /> - <argument index="1" name="alternative_tile" type="int" /> - <description> - </description> - </method> - <method name="has_tile" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="atlas_coords" type="Vector2i" /> - <description> + Returns a tile's texture region in the atlas texture. </description> </method> <method name="has_tiles_outside_texture"> <return type="bool" /> <description> + Returns if this atlas has tiles outside of its texture. </description> </method> <method name="move_tile_in_atlas"> @@ -118,6 +102,9 @@ <argument index="1" name="new_atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" /> <argument index="2" name="new_size" type="Vector2i" default="Vector2i(-1, -1)" /> <description> + Move the tile and its alternatives at the [code]atlas_coords[/code] coordinates to the [code]new_atlas_coords[/code] coordinates with the [code]new_size[/code] size. This functions will fail if a tile is already present in the given area. + If [code]new_atlas_coords[/code] is [code]Vector2i(-1, -1)[/code], keeps the tile's coordinates. If [code]new_size[/code] is [code]Vector2i(-1, -1)[/code], keeps the tile's size. + To avoid an error, first check if a move is possible using [method can_move_tile_in_atlas]. </description> </method> <method name="remove_alternative_tile"> @@ -125,12 +112,15 @@ <argument index="0" name="atlas_coords" type="Vector2i" /> <argument index="1" name="alternative_tile" type="int" /> <description> + Remove a tile's alternative with alternative ID [code]alternative_tile[/code]. + Calling this function with [code]alternative_tile[/code] equals to 0 will fail, as the base tile alternative cannot be removed. </description> </method> <method name="remove_tile"> <return type="void" /> <argument index="0" name="atlas_coords" type="Vector2i" /> <description> + Remove a tile and its alternative at coordinates [code]atlas_coords[/code]. </description> </method> <method name="set_alternative_tile_id"> @@ -139,17 +129,23 @@ <argument index="1" name="alternative_tile" type="int" /> <argument index="2" name="new_id" type="int" /> <description> + Change a tile's alternative ID from [code]alternative_tile[/code] to [code]new_id[/code]. + Calling this function with [code]alternative_id[/code] equals to 0 will fail, as the base tile alternative cannot be moved. </description> </method> </methods> <members> <member name="margins" type="Vector2i" setter="set_margins" getter="get_margins" default="Vector2i(0, 0)"> + Margins, in pixels, to offset the origin of the grid in the texture. </member> <member name="separation" type="Vector2i" setter="set_separation" getter="get_separation" default="Vector2i(0, 0)"> + Separation, in pixels, between each tile texture region of the grid. </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> + The atlas texture. </member> - <member name="tile_size" type="Vector2i" setter="set_texture_region_size" getter="get_texture_region_size" default="Vector2i(16, 16)"> + <member name="texture_region_size" type="Vector2i" setter="set_texture_region_size" getter="get_texture_region_size" default="Vector2i(16, 16)"> + The base tile size in the texture (in pixel). This size must be bigger than the TileSet's [code]tile_size[/code] value. </member> </members> <constants> diff --git a/doc/classes/TileSetScenesCollectionSource.xml b/doc/classes/TileSetScenesCollectionSource.xml index a44f519a4c..119a04c25f 100644 --- a/doc/classes/TileSetScenesCollectionSource.xml +++ b/doc/classes/TileSetScenesCollectionSource.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="TileSetScenesCollectionSource" inherits="TileSetSource" version="4.0"> <brief_description> + Exposes a set of scenes as tiles for a [TileSet] resource. </brief_description> <description> + When placed on a [TileMap], tiles from [TileSetScenesCollectionSource] will automatically instanciate an assiciated scene at the cell's position in the TileMap. + Scenes are instanciated as children of the [TileMap] when it enters the tree. If you add/remove a scene tile in the [TileMap] that is already inside the tree, the [TileMap] will automatically instanciate/free the scene accordingly. </description> <tutorials> </tutorials> @@ -12,83 +15,55 @@ <argument index="0" name="packed_scene" type="PackedScene" /> <argument index="1" name="id_override" type="int" default="-1" /> <description> - </description> - </method> - <method name="get_alternative_tile_id" qualifiers="const"> - <return type="int" /> - <argument index="0" name="atlas_coords" type="Vector2i" /> - <argument index="1" name="index" type="int" /> - <description> - </description> - </method> - <method name="get_alternative_tiles_count" qualifiers="const"> - <return type="int" /> - <argument index="0" name="atlas_coords" type="Vector2i" /> - <description> + Creates a scene-based tile out of the given scene. + Returns a newly generated unique ID. </description> </method> <method name="get_next_scene_tile_id" qualifiers="const"> <return type="int" /> <description> + Returns the scene ID a following call to [method create_scene_tile] would return. </description> </method> <method name="get_scene_tile_display_placeholder" qualifiers="const"> <return type="bool" /> <argument index="0" name="id" type="int" /> <description> + Returns whether the scene tile with id [code]id[/code] displays a placeholder in the editor. </description> </method> <method name="get_scene_tile_id"> <return type="int" /> <argument index="0" name="index" type="int" /> <description> + Returns the scene tile ID of the scene tile at index [code]index[/code]. </description> </method> <method name="get_scene_tile_scene" qualifiers="const"> <return type="PackedScene" /> <argument index="0" name="id" type="int" /> <description> + Returns the [PackedScene] resource of scene tile with id [code]id[/code]. </description> </method> <method name="get_scene_tiles_count"> <return type="int" /> <description> - </description> - </method> - <method name="get_tile_id" qualifiers="const"> - <return type="Vector2i" /> - <argument index="0" name="index" type="int" /> - <description> - </description> - </method> - <method name="get_tiles_count" qualifiers="const"> - <return type="int" /> - <description> - </description> - </method> - <method name="has_alternative_tile" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="atlas_coords" type="Vector2i" /> - <argument index="1" name="alternative_tile" type="int" /> - <description> + Returns the number or scene tiles this TileSet source has. </description> </method> <method name="has_scene_tile_id"> <return type="bool" /> <argument index="0" name="id" type="int" /> <description> - </description> - </method> - <method name="has_tile" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="atlas_coords" type="Vector2i" /> - <description> + Returns whether this TileSet source has a scene tile with id [code]id[/code]. </description> </method> <method name="remove_scene_tile"> <return type="void" /> <argument index="0" name="id" type="int" /> <description> + Remove the scene tile with id [code]id[/code]. </description> </method> <method name="set_scene_tile_display_placeholder"> @@ -96,6 +71,7 @@ <argument index="0" name="id" type="int" /> <argument index="1" name="display_placeholder" type="bool" /> <description> + Sets whether or not the scene tile with id [code]id[/code] should display a placeholder in the editor. This might be useful for scenes that are not visible. </description> </method> <method name="set_scene_tile_id"> @@ -103,6 +79,7 @@ <argument index="0" name="id" type="int" /> <argument index="1" name="new_id" type="int" /> <description> + Changes a scene tile's ID from [code]id[/code] to [code]new_id[/code]. This will fail if there is already a tile with a ID equal to [code]new_id[/code]. </description> </method> <method name="set_scene_tile_scene"> @@ -110,6 +87,7 @@ <argument index="0" name="id" type="int" /> <argument index="1" name="packed_scene" type="PackedScene" /> <description> + Assigns a [PackedScene] resource to the scene tile with id [code]id[/code]. This will fail if the scene does not extend CanvasItem, as positionning properties are needed to place the scene on the TileMap. </description> </method> </methods> diff --git a/doc/classes/TileSetSource.xml b/doc/classes/TileSetSource.xml index 6a3029bb3f..442d845f6c 100644 --- a/doc/classes/TileSetSource.xml +++ b/doc/classes/TileSetSource.xml @@ -1,12 +1,63 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="TileSetSource" inherits="Resource" version="4.0"> <brief_description> + Exposes a set of tiles for a [TileSet] resource. </brief_description> <description> + Exposes a set of tiles for a [TileSet] resource. + Tiles in a source are indexed with two IDs, coordinates ID (of type Vector2i) and an alternative ID (of type int), named according to their use in the [TileSetAtlasSource] class. + Depending on the TileSet source type, those IDs might have restrictions on their values, this is why the base [TileSetSource] class only exposes getters for them. + + You can iterate over all tiles exposed by a TileSetSource by first iterating over coordinates IDs using [method get_tiles_count] and [method get_tile_id], then over alternative IDs using [method get_alternative_tiles_count] and [method get_alternative_tile_id]. </description> <tutorials> </tutorials> <methods> + <method name="get_alternative_tile_id" qualifiers="const"> + <return type="int" /> + <argument index="0" name="atlas_coords" type="Vector2i" /> + <argument index="1" name="index" type="int" /> + <description> + Returns the alternative ID for the tile with coordinates ID [code]atlas_coords[/code] at index [code]index[/code]. + </description> + </method> + <method name="get_alternative_tiles_count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="atlas_coords" type="Vector2i" /> + <description> + Returns the number of alternatives tiles for the coordinates ID [code]atlas_coords[/code]. + For [TileSetAtlasSource], this always return at least 1, as the base tile with ID 0 is always part of the alternatives list. + Returns -1 if there is not tile at the given coords. + </description> + </method> + <method name="get_tile_id" qualifiers="const"> + <return type="Vector2i" /> + <argument index="0" name="index" type="int" /> + <description> + Returns the tile coordinates ID of the tile with index [code]index[/code]. + </description> + </method> + <method name="get_tiles_count" qualifiers="const"> + <return type="int" /> + <description> + Returns how many tiles this atlas source defines (not including alternative tiles). + </description> + </method> + <method name="has_alternative_tile" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="atlas_coords" type="Vector2i" /> + <argument index="1" name="alternative_tile" type="int" /> + <description> + Returns if the base tile at coordinates [code]atlas_coords[/code] has an alternative with ID [code]alternative_tile[/code]. + </description> + </method> + <method name="has_tile" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="atlas_coords" type="Vector2i" /> + <description> + Returns if this atlas has a tile with coordinates ID [code]atlas_coordinates[/code]. + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/VScrollBar.xml b/doc/classes/VScrollBar.xml index 98a0aea0c7..519cc9c137 100644 --- a/doc/classes/VScrollBar.xml +++ b/doc/classes/VScrollBar.xml @@ -23,6 +23,9 @@ <theme_item name="decrement_highlight" data_type="icon" type="Texture2D"> Displayed when the mouse cursor hovers over the decrement button. </theme_item> + <theme_item name="decrement_pressed" data_type="icon" type="Texture2D"> + Displayed when the decrement button is being pressed. + </theme_item> <theme_item name="grabber" data_type="style" type="StyleBox"> Used as texture for the grabber, the draggable element representing current scroll. </theme_item> @@ -38,6 +41,9 @@ <theme_item name="increment_highlight" data_type="icon" type="Texture2D"> Displayed when the mouse cursor hovers over the increment button. </theme_item> + <theme_item name="increment_pressed" data_type="icon" type="Texture2D"> + Displayed when the increment button is being pressed. + </theme_item> <theme_item name="scroll" data_type="style" type="StyleBox"> Used as background of this [ScrollBar]. </theme_item> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index a02a23517f..06a7177bfc 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -321,10 +321,7 @@ <constant name="MSAA_8X" value="3" enum="MSAA"> Use 8× Multisample Antialiasing. This has a very high performance cost. The difference between 4× and 8× MSAA may not always be visible in real gameplay conditions. Likely unsupported on low-end and older hardware. </constant> - <constant name="MSAA_16X" value="4" enum="MSAA"> - Use 16× Multisample Antialiasing. This has a very high performance cost. The difference between 8× and 16× MSAA may not always be visible in real gameplay conditions. Likely unsupported on medium and low-end hardware. - </constant> - <constant name="MSAA_MAX" value="5" enum="MSAA"> + <constant name="MSAA_MAX" value="4" enum="MSAA"> Represents the size of the [enum MSAA] enum. </constant> <constant name="SCREEN_SPACE_AA_DISABLED" value="0" enum="ScreenSpaceAA"> |