2021-05-07 15:41:39 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 10:08:05 +02:00
<class name= "TileData" inherits= "Object" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2021-05-07 15:41:39 +02:00
<brief_description >
2022-11-21 03:48:36 +01:00
Settings for a single tile in a [TileSet].
2021-05-07 15:41:39 +02:00
</brief_description>
<description >
2022-11-21 03:48:36 +01:00
[TileData] object represents a single tile in a [TileSet]. It is usually edited using the tileset editor, but it can be modified at runtime using [method TileMap._tile_data_runtime_update].
2021-05-07 15:41:39 +02:00
</description>
<tutorials >
</tutorials>
<methods >
2021-06-09 20:01:08 +02:00
<method name= "add_collision_polygon" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
2021-05-07 15:41:39 +02:00
<description >
2021-09-06 11:56:31 +02:00
Adds a collision polygon to the tile on the given TileSet physics layer.
2021-05-07 15:41:39 +02:00
</description>
</method>
2024-06-11 12:59:55 +02:00
<method name= "add_occluder_polygon" >
<return type= "void" />
<param index= "0" name= "layer_id" type= "int" />
<description >
Adds an occlusion polygon to the tile on the TileSet occlusion layer with index [param layer_id].
</description>
</method>
2021-06-09 20:01:08 +02:00
<method name= "get_collision_polygon_one_way_margin" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "float" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygon_index" type= "int" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Returns the one-way margin (for one-way platforms) of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2021-06-09 20:01:08 +02:00
<method name= "get_collision_polygon_points" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "PackedVector2Array" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygon_index" type= "int" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Returns the points of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2021-06-09 20:01:08 +02:00
<method name= "get_collision_polygons_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Returns how many polygons the tile has for TileSet physics layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2021-09-15 15:23:58 +02:00
<method name= "get_constant_angular_velocity" qualifiers= "const" >
<return type= "float" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
2021-09-15 15:23:58 +02:00
<description >
Returns the constant angular velocity applied to objects colliding with this tile.
</description>
</method>
<method name= "get_constant_linear_velocity" qualifiers= "const" >
<return type= "Vector2" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
2021-09-15 15:23:58 +02:00
<description >
Returns the constant linear velocity applied to objects colliding with this tile.
</description>
</method>
2021-05-07 15:41:39 +02:00
<method name= "get_custom_data" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Variant" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_name" type= "String" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Returns the custom data value for custom data layer named [param layer_name].
2021-05-07 15:41:39 +02:00
</description>
</method>
<method name= "get_custom_data_by_layer_id" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Variant" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Returns the custom data value for custom data layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
<method name= "get_navigation_polygon" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "NavigationPolygon" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
2023-11-09 12:37:21 +01:00
<param index= "1" name= "flip_h" type= "bool" default= "false" />
<param index= "2" name= "flip_v" type= "bool" default= "false" />
<param index= "3" name= "transpose" type= "bool" default= "false" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Returns the navigation polygon of the tile for the TileSet navigation layer with index [param layer_id].
2023-11-09 12:37:21 +01:00
[param flip_h], [param flip_v], and [param transpose] allow transforming the returned polygon.
2021-05-07 15:41:39 +02:00
</description>
</method>
2024-06-11 12:59:55 +02:00
<method name= "get_occluder" qualifiers= "const" deprecated= "Use [method get_occluder_polygon] instead." >
2021-07-30 15:28:05 +02:00
<return type= "OccluderPolygon2D" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
2023-11-09 12:37:21 +01:00
<param index= "1" name= "flip_h" type= "bool" default= "false" />
<param index= "2" name= "flip_v" type= "bool" default= "false" />
<param index= "3" name= "transpose" type= "bool" default= "false" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Returns the occluder polygon of the tile for the TileSet occlusion layer with index [param layer_id].
2023-11-09 12:37:21 +01:00
[param flip_h], [param flip_v], and [param transpose] allow transforming the returned polygon.
2021-05-07 15:41:39 +02:00
</description>
</method>
2024-06-11 12:59:55 +02:00
<method name= "get_occluder_polygon" qualifiers= "const" >
<return type= "OccluderPolygon2D" />
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygon_index" type= "int" />
<param index= "2" name= "flip_h" type= "bool" default= "false" />
<param index= "3" name= "flip_v" type= "bool" default= "false" />
<param index= "4" name= "transpose" type= "bool" default= "false" />
<description >
Returns the occluder polygon at index [param polygon_index] from the TileSet occlusion layer with index [param layer_id].
The [param flip_h], [param flip_v], and [param transpose] parameters can be [code]true[/code] to transform the returned polygon.
</description>
</method>
<method name= "get_occluder_polygons_count" qualifiers= "const" >
<return type= "int" />
<param index= "0" name= "layer_id" type= "int" />
<description >
Returns the number of occluder polygons of the tile in the TileSet occlusion layer with index [param layer_id].
</description>
</method>
2022-02-23 17:25:50 +01:00
<method name= "get_terrain_peering_bit" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "peering_bit" type= "int" enum= "TileSet.CellNeighbor" />
2021-05-07 15:41:39 +02:00
<description >
2024-03-26 16:07:38 +01:00
Returns the tile's terrain bit for the given [param peering_bit] direction. To check that a direction is valid, use [method is_valid_terrain_peering_bit].
2021-05-07 15:41:39 +02:00
</description>
</method>
2021-06-09 20:01:08 +02:00
<method name= "is_collision_polygon_one_way" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygon_index" type= "int" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Returns whether one-way collisions are enabled for the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2024-03-26 16:07:38 +01:00
<method name= "is_valid_terrain_peering_bit" qualifiers= "const" >
<return type= "bool" />
<param index= "0" name= "peering_bit" type= "int" enum= "TileSet.CellNeighbor" />
<description >
Returns whether the given [param peering_bit] direction is valid for this tile.
</description>
</method>
2021-06-09 20:01:08 +02:00
<method name= "remove_collision_polygon" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygon_index" type= "int" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Removes the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2024-06-11 12:59:55 +02:00
<method name= "remove_occluder_polygon" >
<return type= "void" />
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygon_index" type= "int" />
<description >
Removes the polygon at index [param polygon_index] for TileSet occlusion layer with index [param layer_id].
</description>
</method>
2021-06-09 20:01:08 +02:00
<method name= "set_collision_polygon_one_way" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygon_index" type= "int" />
<param index= "2" name= "one_way" type= "bool" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Enables/disables one-way collisions on the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2021-06-09 20:01:08 +02:00
<method name= "set_collision_polygon_one_way_margin" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygon_index" type= "int" />
<param index= "2" name= "one_way_margin" type= "float" />
2021-05-07 15:41:39 +02:00
<description >
2024-07-17 18:44:27 +02:00
Sets the one-way margin (for one-way platforms) of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2021-06-09 20:01:08 +02:00
<method name= "set_collision_polygon_points" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygon_index" type= "int" />
<param index= "2" name= "polygon" type= "PackedVector2Array" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Sets the points of the polygon at index [param polygon_index] for TileSet physics layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2021-06-09 20:01:08 +02:00
<method name= "set_collision_polygons_count" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygons_count" type= "int" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Sets the polygons count for TileSet physics layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2021-09-15 15:23:58 +02:00
<method name= "set_constant_angular_velocity" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "velocity" type= "float" />
2021-09-15 15:23:58 +02:00
<description >
Sets the constant angular velocity. This does not rotate the tile. This angular velocity is applied to objects colliding with this tile.
</description>
</method>
<method name= "set_constant_linear_velocity" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "velocity" type= "Vector2" />
2021-09-15 15:23:58 +02:00
<description >
Sets the constant linear velocity. This does not move the tile. This linear velocity is applied to objects colliding with this tile. This is useful to create conveyor belts.
</description>
</method>
2021-05-07 15:41:39 +02:00
<method name= "set_custom_data" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_name" type= "String" />
<param index= "1" name= "value" type= "Variant" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Sets the tile's custom data value for the TileSet custom data layer with name [param layer_name].
2021-05-07 15:41:39 +02:00
</description>
</method>
<method name= "set_custom_data_by_layer_id" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "value" type= "Variant" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Sets the tile's custom data value for the TileSet custom data layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
<method name= "set_navigation_polygon" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "navigation_polygon" type= "NavigationPolygon" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Sets the navigation polygon for the TileSet navigation layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2024-06-11 12:59:55 +02:00
<method name= "set_occluder" deprecated= "Use [method set_occluder_polygon] instead." >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "occluder_polygon" type= "OccluderPolygon2D" />
2021-05-07 15:41:39 +02:00
<description >
2022-08-09 17:19:47 +02:00
Sets the occluder for the TileSet occlusion layer with index [param layer_id].
2021-05-07 15:41:39 +02:00
</description>
</method>
2024-06-11 12:59:55 +02:00
<method name= "set_occluder_polygon" >
<return type= "void" />
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygon_index" type= "int" />
<param index= "2" name= "polygon" type= "OccluderPolygon2D" />
<description >
Sets the occluder for polygon with index [param polygon_index] in the TileSet occlusion layer with index [param layer_id].
</description>
</method>
<method name= "set_occluder_polygons_count" >
<return type= "void" />
<param index= "0" name= "layer_id" type= "int" />
<param index= "1" name= "polygons_count" type= "int" />
<description >
Sets the occluder polygon count in the TileSet occlusion layer with index [param layer_id].
</description>
</method>
2022-02-23 17:25:50 +01:00
<method name= "set_terrain_peering_bit" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "peering_bit" type= "int" enum= "TileSet.CellNeighbor" />
<param index= "1" name= "terrain" type= "int" />
2021-05-07 15:41:39 +02:00
<description >
2024-03-26 16:07:38 +01:00
Sets the tile's terrain bit for the given [param peering_bit] direction. To check that a direction is valid, use [method is_valid_terrain_peering_bit].
2021-05-07 15:41:39 +02:00
</description>
</method>
</methods>
<members >
<member name= "flip_h" type= "bool" setter= "set_flip_h" getter= "get_flip_h" default= "false" >
2022-11-21 03:48:36 +01:00
If [code]true[/code], the tile will have its texture flipped horizontally.
2021-05-07 15:41:39 +02:00
</member>
<member name= "flip_v" type= "bool" setter= "set_flip_v" getter= "get_flip_v" default= "false" >
2022-11-21 03:48:36 +01:00
If [code]true[/code], the tile will have its texture flipped vertically.
2021-05-07 15:41:39 +02:00
</member>
2022-02-26 00:24:08 +01:00
<member name= "material" type= "Material" setter= "set_material" getter= "get_material" >
The [Material] to use for this [TileData]. This can be a [CanvasItemMaterial] to use the default shader, or a [ShaderMaterial] to use a custom shader.
2021-09-06 11:56:31 +02:00
</member>
2024-02-21 18:51:08 +01:00
<member name= "modulate" type= "Color" setter= "set_modulate" getter= "get_modulate" default= "Color(1, 1, 1, 1)" keywords= "color, colour" >
2022-11-21 03:48:36 +01:00
Color modulation of the tile.
2021-05-07 15:41:39 +02:00
</member>
<member name= "probability" type= "float" setter= "set_probability" getter= "get_probability" default= "1.0" >
2022-11-21 03:48:36 +01:00
Relative probability of this tile being selected when drawing a pattern of random tiles.
2021-05-07 15:41:39 +02:00
</member>
2022-02-23 17:25:50 +01:00
<member name= "terrain" type= "int" setter= "set_terrain" getter= "get_terrain" default= "-1" >
2022-11-21 03:48:36 +01:00
ID of the terrain from the terrain set that the tile uses.
2022-02-23 17:25:50 +01:00
</member>
2021-05-07 15:41:39 +02:00
<member name= "terrain_set" type= "int" setter= "set_terrain_set" getter= "get_terrain_set" default= "-1" >
2022-11-21 03:48:36 +01:00
ID of the terrain set that the tile uses.
2021-05-07 15:41:39 +02:00
</member>
2023-01-26 18:47:54 +01:00
<member name= "texture_origin" type= "Vector2i" setter= "set_texture_origin" getter= "get_texture_origin" default= "Vector2i(0, 0)" >
2022-11-21 03:48:36 +01:00
Offsets the position of where the tile is drawn.
2021-05-07 15:41:39 +02:00
</member>
<member name= "transpose" type= "bool" setter= "set_transpose" getter= "get_transpose" default= "false" >
2022-11-21 03:48:36 +01:00
If [code]true[/code], the tile will display transposed, i.e. with horizontal and vertical texture UVs swapped.
2021-05-07 15:41:39 +02:00
</member>
2021-05-21 10:08:15 +02:00
<member name= "y_sort_origin" type= "int" setter= "set_y_sort_origin" getter= "get_y_sort_origin" default= "0" >
2022-11-21 03:48:36 +01:00
Vertical point of the tile used for determining y-sorted order.
2021-05-07 15:41:39 +02:00
</member>
<member name= "z_index" type= "int" setter= "set_z_index" getter= "get_z_index" default= "0" >
2022-11-21 03:48:36 +01:00
Ordering index of this tile, relative to [TileMap].
2021-05-07 15:41:39 +02:00
</member>
</members>
<signals >
<signal name= "changed" >
<description >
2022-11-21 03:48:36 +01:00
Emitted when any of the properties are changed.
2021-05-07 15:41:39 +02:00
</description>
</signal>
</signals>
</class>