diff options
Diffstat (limited to 'doc/classes/TileSet.xml')
-rw-r--r-- | doc/classes/TileSet.xml | 978 |
1 files changed, 420 insertions, 558 deletions
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 4991a1e58b..02baded019 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -4,779 +4,641 @@ 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> + <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link> + <link title="2D Isometric Demo">https://godotengine.org/asset-library/asset/112</link> + <link title="2D Hexagonal Demo">https://godotengine.org/asset-library/asset/111</link> + <link title="2D Navigation Astar Demo">https://godotengine.org/asset-library/asset/519</link> + <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link> + <link title="2D Kinematic Character Demo">https://godotengine.org/asset-library/asset/113</link> </tutorials> <methods> - <method name="_forward_atlas_subtile_selection" qualifiers="virtual"> - <return type="Vector2"> - </return> - <argument index="0" name="atlastile_id" type="int"> - </argument> - <argument index="1" name="tilemap" type="Object"> - </argument> - <argument index="2" name="tile_location" type="Vector2"> - </argument> + <method name="add_custom_data_layer"> + <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="_forward_subtile_selection" qualifiers="virtual"> - <return type="Vector2"> - </return> - <argument index="0" name="autotile_id" type="int"> - </argument> - <argument index="1" name="bitmask" type="int"> - </argument> - <argument index="2" name="tilemap" type="Object"> - </argument> - <argument index="3" name="tile_location" type="Vector2"> - </argument> + <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="_is_tile_bound" qualifiers="virtual"> - <return type="bool"> - </return> - <argument index="0" name="drawn_id" type="int"> - </argument> - <argument index="1" name="neighbor_id" type="int"> - </argument> + <method name="add_occlusion_layer"> + <return type="void" /> + <argument index="0" name="to_position" type="int" default="-1" /> <description> - Determines when the auto-tiler should consider two different auto-tile IDs to be bound together. - [b]Note:[/b] [code]neighbor_id[/code] will be [code]-1[/code] ([constant TileMap.INVALID_CELL]) when checking a tile against an empty neighbor tile. + 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="autotile_clear_bitmask_map"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="add_physics_layer"> + <return type="void" /> + <argument index="0" name="to_position" type="int" default="-1" /> <description> - Clears all bitmask information of the autotile. + 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="autotile_get_bitmask"> - <return type="int"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="coord" type="Vector2"> - </argument> + <method name="add_source"> + <return type="int" /> + <argument index="0" name="source" type="TileSetSource" /> + <argument index="1" name="atlas_source_id_override" type="int" default="-1" /> <description> - Returns the bitmask of the subtile from an autotile given its coordinates. - The value is the sum of the values in [enum AutotileBindings] present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right). + 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="autotile_get_bitmask_mode" qualifiers="const"> - <return type="int" enum="TileSet.BitmaskMode"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="add_terrain"> + <return type="void" /> + <argument index="0" name="terrain_set" type="int" /> + <argument index="1" name="to_position" type="int" default="-1" /> <description> - Returns the [enum BitmaskMode] of the autotile. + 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="autotile_get_icon_coordinate" qualifiers="const"> - <return type="Vector2"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="add_terrain_set"> + <return type="void" /> + <argument index="0" name="to_position" type="int" default="-1" /> <description> - Returns the subtile that's being used as an icon in an atlas/autotile given its coordinates. - The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor. + 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="autotile_get_light_occluder" qualifiers="const"> - <return type="OccluderPolygon2D"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="coord" type="Vector2"> - </argument> + <method name="cleanup_invalid_tile_proxies"> + <return type="void" /> <description> - Returns the light occluder of the subtile from an atlas/autotile given its coordinates. + Clears tile proxies pointing to invalid tiles. </description> </method> - <method name="autotile_get_navigation_polygon" qualifiers="const"> - <return type="NavigationPolygon"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="coord" type="Vector2"> - </argument> + <method name="clear_tile_proxies"> + <return type="void" /> <description> - Returns the navigation polygon of the subtile from an atlas/autotile given its coordinates. + Clears all tile proxies. </description> </method> - <method name="autotile_get_size" qualifiers="const"> - <return type="Vector2"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="get_alternative_level_tile_proxy"> + <return type="Array" /> + <argument index="0" name="source_from" type="int" /> + <argument index="1" name="coords_from" type="Vector2i" /> + <argument index="2" name="alternative_from" type="int" /> <description> - Returns the size of the subtiles in an atlas/autotile. + 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="autotile_get_spacing" qualifiers="const"> - <return type="int"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="get_coords_level_tile_proxy"> + <return type="Array" /> + <argument index="0" name="source_from" type="int" /> + <argument index="1" name="coords_from" type="Vector2i" /> <description> - Returns the spacing between subtiles of the atlas/autotile. + 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="autotile_get_subtile_priority"> - <return type="int"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="coord" type="Vector2"> - </argument> + <method name="get_custom_data_layers_count" qualifiers="const"> + <return type="int" /> <description> - Returns the priority of the subtile from an autotile given its coordinates. - When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked. + Returns the custom data layers count. </description> </method> - <method name="autotile_get_z_index"> - <return type="int"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="coord" type="Vector2"> - </argument> + <method name="get_navigation_layer_layers" qualifiers="const"> + <return type="int" /> + <argument index="0" name="layer_index" type="int" /> <description> - Returns the drawing index of the subtile from an atlas/autotile given its coordinates. + Returns the navigation layers (as in the Navigation server) of the gives TileSet navigation layer. </description> </method> - <method name="autotile_set_bitmask"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="bitmask" type="Vector2"> - </argument> - <argument index="2" name="flag" type="int"> - </argument> + <method name="get_navigation_layers_count" qualifiers="const"> + <return type="int" /> <description> - Sets the bitmask of the subtile from an autotile given its coordinates. - The value is the sum of the values in [enum AutotileBindings] present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right). + Returns the navigation layers count. </description> </method> - <method name="autotile_set_bitmask_mode"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="mode" type="int" enum="TileSet.BitmaskMode"> - </argument> + <method name="get_next_source_id" qualifiers="const"> + <return type="int" /> <description> - Sets the [enum BitmaskMode] of the autotile. + 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="autotile_set_icon_coordinate"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="coord" type="Vector2"> - </argument> + <method name="get_occlusion_layer_light_mask" qualifiers="const"> + <return type="int" /> + <argument index="0" name="layer_index" type="int" /> <description> - Sets the subtile that will be used as an icon in an atlas/autotile given its coordinates. - The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor. + Returns the light mask of the occlusion layer. </description> </method> - <method name="autotile_set_light_occluder"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="light_occluder" type="OccluderPolygon2D"> - </argument> - <argument index="2" name="coord" type="Vector2"> - </argument> + <method name="get_occlusion_layer_sdf_collision" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="layer_index" type="int" /> <description> - Sets the light occluder of the subtile from an atlas/autotile given its coordinates. + Returns if the occluders from this layer use [code]sdf_collision[/code]. </description> </method> - <method name="autotile_set_navigation_polygon"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="navigation_polygon" type="NavigationPolygon"> - </argument> - <argument index="2" name="coord" type="Vector2"> - </argument> + <method name="get_occlusion_layers_count" qualifiers="const"> + <return type="int" /> <description> - Sets the navigation polygon of the subtile from an atlas/autotile given its coordinates. + Returns the occlusion layers count. </description> </method> - <method name="autotile_set_size"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="size" type="Vector2"> - </argument> + <method name="get_physics_layer_collision_layer" qualifiers="const"> + <return type="int" /> + <argument index="0" name="layer_index" type="int" /> <description> - Sets the size of the subtiles in an atlas/autotile. + Returns the collision layer (as in the physics server) bodies on the given TileSet's physics layer are in. </description> </method> - <method name="autotile_set_spacing"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="spacing" type="int"> - </argument> + <method name="get_physics_layer_collision_mask" qualifiers="const"> + <return type="int" /> + <argument index="0" name="layer_index" type="int" /> <description> - Sets the spacing between subtiles of the atlas/autotile. + Returns the collision mask of bodies on the given TileSet's physics layer. </description> </method> - <method name="autotile_set_subtile_priority"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="coord" type="Vector2"> - </argument> - <argument index="2" name="priority" type="int"> - </argument> + <method name="get_physics_layer_physics_material" qualifiers="const"> + <return type="PhysicsMaterial" /> + <argument index="0" name="layer_index" type="int" /> <description> - Sets the priority of the subtile from an autotile given its coordinates. - When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked. + Returns the physics material of bodies on the given TileSet's physics layer. </description> </method> - <method name="autotile_set_z_index"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="coord" type="Vector2"> - </argument> - <argument index="2" name="z_index" type="int"> - </argument> + <method name="get_physics_layers_count" qualifiers="const"> + <return type="int" /> <description> - Sets the drawing index of the subtile from an atlas/autotile given its coordinates. + Returns the physics layers count. </description> </method> - <method name="clear"> - <return type="void"> - </return> + <method name="get_source" qualifiers="const"> + <return type="TileSetSource" /> + <argument index="0" name="source_id" type="int" /> <description> - Clears all tiles. + Returns the [TileSetSource] with ID [code]source_id[/code]. </description> </method> - <method name="create_tile"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="get_source_count" qualifiers="const"> + <return type="int" /> <description> - Creates a new tile with the given ID. + Returns the number of [TileSetSource] in this TileSet. </description> </method> - <method name="find_tile_by_name" qualifiers="const"> - <return type="int"> - </return> - <argument index="0" name="name" type="String"> - </argument> + <method name="get_source_id" qualifiers="const"> + <return type="int" /> + <argument index="0" name="index" type="int" /> <description> - Returns the first tile matching the given name. + Returns the source ID for source with index [code]index[/code]. </description> </method> - <method name="get_last_unused_tile_id" qualifiers="const"> - <return type="int"> - </return> + <method name="get_source_level_tile_proxy"> + <return type="int" /> + <argument index="0" name="source_from" type="int" /> <description> - Returns the ID following the last currently used ID, useful when creating a new tile. + 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_tiles_ids" qualifiers="const"> - <return type="Array"> - </return> + <method name="get_terrain_color" qualifiers="const"> + <return type="Color" /> + <argument index="0" name="terrain_set" type="int" /> + <argument index="1" name="terrain_index" type="int" /> <description> - Returns an array of all currently used tile IDs. + Returns a terrain's color. </description> </method> - <method name="remove_tile"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="get_terrain_name" qualifiers="const"> + <return type="String" /> + <argument index="0" name="terrain_set" type="int" /> + <argument index="1" name="terrain_index" type="int" /> <description> - Removes the given tile ID. + Returns a terrain's name. </description> </method> - <method name="tile_add_shape"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape" type="Shape2D"> - </argument> - <argument index="2" name="shape_transform" type="Transform2D"> - </argument> - <argument index="3" name="one_way" type="bool" default="false"> - </argument> - <argument index="4" name="autotile_coord" type="Vector2" default="Vector2( 0, 0 )"> - </argument> + <method name="get_terrain_set_mode" qualifiers="const"> + <return type="int" enum="TileSet.TerrainMode" /> + <argument index="0" name="terrain_set" type="int" /> <description> - Adds a shape to the tile. + Returns a terrain set mode. </description> </method> - <method name="tile_get_light_occluder" qualifiers="const"> - <return type="OccluderPolygon2D"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="get_terrain_sets_count" qualifiers="const"> + <return type="int" /> <description> - Returns the tile's light occluder. + Returns the terrain sets count. </description> </method> - <method name="tile_get_material" qualifiers="const"> - <return type="ShaderMaterial"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="get_terrains_count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="terrain_set" type="int" /> <description> - Returns the tile's material. + Returns the number of terrains in the given terrain set. </description> </method> - <method name="tile_get_modulate" qualifiers="const"> - <return type="Color"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="has_alternative_level_tile_proxy"> + <return type="bool" /> + <argument index="0" name="source_from" type="int" /> + <argument index="1" name="coords_from" type="Vector2i" /> + <argument index="2" name="alternative_from" type="int" /> <description> - Returns the tile's modulation color. + Returns if there is and alternative-level proxy for the given identifiers. </description> </method> - <method name="tile_get_name" qualifiers="const"> - <return type="String"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="has_coords_level_tile_proxy"> + <return type="bool" /> + <argument index="0" name="source_from" type="int" /> + <argument index="1" name="coords_from" type="Vector2i" /> <description> - Returns the tile's name. + Returns if there is a coodinates-level proxy for the given identifiers. </description> </method> - <method name="tile_get_navigation_polygon" qualifiers="const"> - <return type="NavigationPolygon"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="has_source" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="source_id" type="int" /> <description> - Returns the navigation polygon of the tile. + Returns if this TileSet has a source for the given source ID. </description> </method> - <method name="tile_get_navigation_polygon_offset" qualifiers="const"> - <return type="Vector2"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="has_source_level_tile_proxy"> + <return type="bool" /> + <argument index="0" name="source_from" type="int" /> <description> - Returns the offset of the tile's navigation polygon. + Returns if there is a source-level proxy for the given source ID. </description> </method> - <method name="tile_get_normal_map" qualifiers="const"> - <return type="Texture2D"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="map_tile_proxy" qualifiers="const"> + <return type="Array" /> + <argument index="0" name="source_from" type="int" /> + <argument index="1" name="coords_from" type="Vector2i" /> + <argument index="2" name="alternative_from" type="int" /> <description> - Returns the tile's normal map texture. + 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="tile_get_occluder_offset" qualifiers="const"> - <return type="Vector2"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="move_custom_data_layer"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> + <argument index="1" name="to_position" type="int" /> <description> - Returns the offset of the tile's light occluder. + 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="tile_get_region" qualifiers="const"> - <return type="Rect2"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="move_navigation_layer"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> + <argument index="1" name="to_position" type="int" /> <description> - Returns the tile sub-region in the texture. + 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="tile_get_shape" qualifiers="const"> - <return type="Shape2D"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape_id" type="int"> - </argument> + <method name="move_occlusion_layer"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> + <argument index="1" name="to_position" type="int" /> <description> - Returns a tile's given shape. + 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="tile_get_shape_count" qualifiers="const"> - <return type="int"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="move_physics_layer"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> + <argument index="1" name="to_position" type="int" /> <description> - Returns the number of shapes assigned to a tile. + 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="tile_get_shape_offset" qualifiers="const"> - <return type="Vector2"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape_id" type="int"> - </argument> + <method name="move_terrain"> + <return type="void" /> + <argument index="0" name="terrain_set" type="int" /> + <argument index="1" name="terrain_index" type="int" /> + <argument index="2" name="to_position" type="int" /> <description> - Returns the offset of a tile's shape. + 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="tile_get_shape_one_way" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape_id" type="int"> - </argument> + <method name="move_terrain_set"> + <return type="void" /> + <argument index="0" name="terrain_set" type="int" /> + <argument index="1" name="to_position" type="int" /> <description> - Returns the one-way collision value of a tile's shape. + 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="tile_get_shape_one_way_margin" qualifiers="const"> - <return type="float"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape_id" type="int"> - </argument> + <method name="remove_alternative_level_tile_proxy"> + <return type="void" /> + <argument index="0" name="source_from" type="int" /> + <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="tile_get_shape_transform" qualifiers="const"> - <return type="Transform2D"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape_id" type="int"> - </argument> + <method name="remove_coords_level_tile_proxy"> + <return type="void" /> + <argument index="0" name="source_from" type="int" /> + <argument index="1" name="coords_from" type="Vector2i" /> <description> - Returns the [Transform2D] of a tile's shape. + Removes a coordinates-level proxy for the given identifiers. </description> </method> - <method name="tile_get_shapes" qualifiers="const"> - <return type="Array"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="remove_custom_data_layer"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> <description> - Returns an array of dictionaries describing the tile's shapes. - [b]Dictionary structure in the array returned by this method:[/b] - [codeblock] - { - "autotile_coord": Vector2, - "one_way": bool, - "one_way_margin": int, - "shape": CollisionShape2D, - "shape_transform": Transform2D, - } - [/codeblock] + Removes the custom data layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly. </description> </method> - <method name="tile_get_texture" qualifiers="const"> - <return type="Texture2D"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="remove_navigation_layer"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> <description> - Returns the tile's texture. + Removes the navigation layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly. </description> </method> - <method name="tile_get_texture_offset" qualifiers="const"> - <return type="Vector2"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="remove_occlusion_layer"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> <description> - Returns the texture offset of the tile. + Removes the occlusion layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly. </description> </method> - <method name="tile_get_tile_mode" qualifiers="const"> - <return type="int" enum="TileSet.TileMode"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="remove_physics_layer"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> <description> - Returns the tile's [enum TileMode]. + Removes the physics layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly. </description> </method> - <method name="tile_get_z_index" qualifiers="const"> - <return type="int"> - </return> - <argument index="0" name="id" type="int"> - </argument> + <method name="remove_source"> + <return type="void" /> + <argument index="0" name="source_id" type="int" /> <description> - Returns the tile's Z index (drawing layer). + Removes the source with the given source ID. </description> </method> - <method name="tile_set_light_occluder"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="light_occluder" type="OccluderPolygon2D"> - </argument> + <method name="remove_source_level_tile_proxy"> + <return type="void" /> + <argument index="0" name="source_from" type="int" /> <description> - Sets a light occluder for the tile. + Removes a source-level tile proxy. </description> </method> - <method name="tile_set_material"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="material" type="ShaderMaterial"> - </argument> + <method name="remove_terrain"> + <return type="void" /> + <argument index="0" name="terrain_set" type="int" /> + <argument index="1" name="terrain_index" type="int" /> <description> - Sets the tile's material. + 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="tile_set_modulate"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="color" type="Color"> - </argument> + <method name="remove_terrain_set"> + <return type="void" /> + <argument index="0" name="terrain_set" type="int" /> <description> - Sets the tile's modulation color. + Removes the terrain set at index [code]terrain_set[/code]. Also updates the atlas tiles accordingly. </description> </method> - <method name="tile_set_name"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="name" type="String"> - </argument> + <method name="set_alternative_level_tile_proxy"> + <return type="void" /> + <argument index="0" name="source_from" type="int" /> + <argument index="1" name="coords_from" type="Vector2i" /> + <argument index="2" name="alternative_from" type="int" /> + <argument index="3" name="source_to" type="int" /> + <argument index="4" name="coords_to" type="Vector2i" /> + <argument index="5" name="alternative_to" type="int" /> <description> - Sets the tile's name. + 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="tile_set_navigation_polygon"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="navigation_polygon" type="NavigationPolygon"> - </argument> + <method name="set_coords_level_tile_proxy"> + <return type="void" /> + <argument index="0" name="p_source_from" type="int" /> + <argument index="1" name="coords_from" type="Vector2i" /> + <argument index="2" name="source_to" type="int" /> + <argument index="3" name="coords_to" type="Vector2i" /> <description> - Sets the tile's navigation polygon. + 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="tile_set_navigation_polygon_offset"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="navigation_polygon_offset" type="Vector2"> - </argument> + <method name="set_navigation_layer_layers"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> + <argument index="1" name="layers" type="int" /> <description> - Sets an offset for the tile's navigation polygon. + Sets the navigation layers (as in the navigation server) for navigation regions is the given TileSet navigation layer. </description> </method> - <method name="tile_set_normal_map"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="normal_map" type="Texture2D"> - </argument> + <method name="set_occlusion_layer_light_mask"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> + <argument index="1" name="light_mask" type="int" /> <description> - Sets the tile's normal map texture. - [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. + Sets the occlusion layer (as in the rendering server) for occluders in the given TileSet occlusion layer. </description> </method> - <method name="tile_set_occluder_offset"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="occluder_offset" type="Vector2"> - </argument> + <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="bool" /> <description> - Sets an offset for the tile's light occluder. + Enables or disables sdf collision for occluders in the given TileSet occlusion layer. </description> </method> - <method name="tile_set_region"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="region" type="Rect2"> - </argument> + <method name="set_physics_layer_collision_layer"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> + <argument index="1" name="layer" type="int" /> <description> - Sets the tile's sub-region in the texture. This is common in texture atlases. + Sets the physics layer (as in the physics server) for bodies in the given TileSet physics layer. </description> </method> - <method name="tile_set_shape"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape_id" type="int"> - </argument> - <argument index="2" name="shape" type="Shape2D"> - </argument> + <method name="set_physics_layer_collision_mask"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> + <argument index="1" name="mask" type="int" /> <description> - Sets a shape for the tile, enabling collision. + Sets the physics layer (as in the physics server) for bodies in the given TileSet physics layer. </description> </method> - <method name="tile_set_shape_offset"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape_id" type="int"> - </argument> - <argument index="2" name="shape_offset" type="Vector2"> - </argument> + <method name="set_physics_layer_physics_material"> + <return type="void" /> + <argument index="0" name="layer_index" type="int" /> + <argument index="1" name="physics_material" type="PhysicsMaterial" /> <description> - Sets the offset of a tile's shape. + Sets the physics material for bodies in the given TileSet physics layer. </description> </method> - <method name="tile_set_shape_one_way"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape_id" type="int"> - </argument> - <argument index="2" name="one_way" type="bool"> - </argument> + <method name="set_source_id"> + <return type="void" /> + <argument index="0" name="source_id" type="int" /> + <argument index="1" name="new_source_id" type="int" /> <description> - Enables one-way collision on a tile's shape. + Changes a source's ID. </description> </method> - <method name="tile_set_shape_one_way_margin"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape_id" type="int"> - </argument> - <argument index="2" name="one_way" type="float"> - </argument> + <method name="set_source_level_tile_proxy"> + <return type="void" /> + <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="tile_set_shape_transform"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shape_id" type="int"> - </argument> - <argument index="2" name="shape_transform" type="Transform2D"> - </argument> + <method name="set_terrain_color"> + <return type="void" /> + <argument index="0" name="terrain_set" type="int" /> + <argument index="1" name="terrain_index" type="int" /> + <argument index="2" name="color" type="Color" /> <description> - Sets a [Transform2D] on a tile's shape. + Sets a terrain's color. This color is used for identifying the different terrains in the TileSet editor. </description> </method> - <method name="tile_set_shapes"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="shapes" type="Array"> - </argument> + <method name="set_terrain_name"> + <return type="void" /> + <argument index="0" name="terrain_set" type="int" /> + <argument index="1" name="terrain_index" type="int" /> + <argument index="2" name="name" type="String" /> <description> - Sets an array of shapes for the tile, enabling collision. + Sets a terrain's name. </description> </method> - <method name="tile_set_texture"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="texture" type="Texture2D"> - </argument> + <method name="set_terrain_set_mode"> + <return type="void" /> + <argument index="0" name="terrain_set" type="int" /> + <argument index="1" name="mode" type="int" enum="TileSet.TerrainMode" /> <description> - Sets the tile's texture. - </description> - </method> - <method name="tile_set_texture_offset"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="texture_offset" type="Vector2"> - </argument> - <description> - Sets the tile's texture offset. - </description> - </method> - <method name="tile_set_tile_mode"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="tilemode" type="int" enum="TileSet.TileMode"> - </argument> - <description> - Sets the tile's [enum TileMode]. - </description> - </method> - <method name="tile_set_z_index"> - <return type="void"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="z_index" type="int"> - </argument> - <description> - Sets the tile's drawing index. + 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="BITMASK_2X2" value="0" enum="BitmaskMode"> + <constant name="TILE_SHAPE_SQUARE" value="0" enum="TileShape"> + Rectangular tile shape. + </constant> + <constant name="TILE_SHAPE_ISOMETRIC" value="1" enum="TileShape"> + 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"> + 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="BITMASK_3X3_MINIMAL" value="1" enum="BitmaskMode"> + <constant name="CELL_NEIGHBOR_BOTTOM_CORNER" value="5" enum="CellNeighbor"> + Neighbor in the bottom corner. </constant> - <constant name="BITMASK_3X3" value="2" enum="BitmaskMode"> + <constant name="CELL_NEIGHBOR_BOTTOM_LEFT_SIDE" value="6" enum="CellNeighbor"> + Neighbor on the bottom left side. </constant> - <constant name="BIND_TOPLEFT" value="1" enum="AutotileBindings"> + <constant name="CELL_NEIGHBOR_BOTTOM_LEFT_CORNER" value="7" enum="CellNeighbor"> + Neighbor in the bottom left corner. </constant> - <constant name="BIND_TOP" value="2" enum="AutotileBindings"> + <constant name="CELL_NEIGHBOR_LEFT_SIDE" value="8" enum="CellNeighbor"> + Neighbor on the left side. </constant> - <constant name="BIND_TOPRIGHT" value="4" enum="AutotileBindings"> + <constant name="CELL_NEIGHBOR_LEFT_CORNER" value="9" enum="CellNeighbor"> + Neighbor in the left corner. </constant> - <constant name="BIND_LEFT" value="8" enum="AutotileBindings"> + <constant name="CELL_NEIGHBOR_TOP_LEFT_SIDE" value="10" enum="CellNeighbor"> + Neighbor on the top left side. </constant> - <constant name="BIND_CENTER" value="16" enum="AutotileBindings"> + <constant name="CELL_NEIGHBOR_TOP_LEFT_CORNER" value="11" enum="CellNeighbor"> + Neighbor in the top left corner. </constant> - <constant name="BIND_RIGHT" value="32" enum="AutotileBindings"> + <constant name="CELL_NEIGHBOR_TOP_SIDE" value="12" enum="CellNeighbor"> + Neighbor on the top side. </constant> - <constant name="BIND_BOTTOMLEFT" value="64" enum="AutotileBindings"> + <constant name="CELL_NEIGHBOR_TOP_CORNER" value="13" enum="CellNeighbor"> + Neighbor in the top corner. </constant> - <constant name="BIND_BOTTOM" value="128" enum="AutotileBindings"> + <constant name="CELL_NEIGHBOR_TOP_RIGHT_SIDE" value="14" enum="CellNeighbor"> + Neighbor on the top right side. </constant> - <constant name="BIND_BOTTOMRIGHT" value="256" enum="AutotileBindings"> + <constant name="CELL_NEIGHBOR_TOP_RIGHT_CORNER" value="15" enum="CellNeighbor"> + Neighbor in the top right corner. </constant> - <constant name="SINGLE_TILE" value="0" enum="TileMode"> + <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="AUTO_TILE" value="1" enum="TileMode"> + <constant name="TERRAIN_MODE_MATCH_CORNERS" value="1" enum="TerrainMode"> + Requires corners to match with neighboring tiles' terrains. </constant> - <constant name="ATLAS_TILE" value="2" enum="TileMode"> + <constant name="TERRAIN_MODE_MATCH_SIDES" value="2" enum="TerrainMode"> + Requires sides to match with neighboring tiles' terrains. </constant> </constants> </class> |