class_tiledata.rst 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TileData.xml.
  6. .. _class_TileData:
  7. TileData
  8. ========
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Settings for a single tile in a :ref:`TileSet<class_TileSet>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **TileData** object represents a single tile in a :ref:`TileSet<class_TileSet>`. It is usually edited using the tileset editor, but it can be modified at runtime using :ref:`TileMap._tile_data_runtime_update<class_TileMap_private_method__tile_data_runtime_update>`.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +---------------------------------+---------------------------------------------------------------+-----------------------+
  21. | :ref:`bool<class_bool>` | :ref:`flip_h<class_TileData_property_flip_h>` | ``false`` |
  22. +---------------------------------+---------------------------------------------------------------+-----------------------+
  23. | :ref:`bool<class_bool>` | :ref:`flip_v<class_TileData_property_flip_v>` | ``false`` |
  24. +---------------------------------+---------------------------------------------------------------+-----------------------+
  25. | :ref:`Material<class_Material>` | :ref:`material<class_TileData_property_material>` | |
  26. +---------------------------------+---------------------------------------------------------------+-----------------------+
  27. | :ref:`Color<class_Color>` | :ref:`modulate<class_TileData_property_modulate>` | ``Color(1, 1, 1, 1)`` |
  28. +---------------------------------+---------------------------------------------------------------+-----------------------+
  29. | :ref:`float<class_float>` | :ref:`probability<class_TileData_property_probability>` | ``1.0`` |
  30. +---------------------------------+---------------------------------------------------------------+-----------------------+
  31. | :ref:`int<class_int>` | :ref:`terrain<class_TileData_property_terrain>` | ``-1`` |
  32. +---------------------------------+---------------------------------------------------------------+-----------------------+
  33. | :ref:`int<class_int>` | :ref:`terrain_set<class_TileData_property_terrain_set>` | ``-1`` |
  34. +---------------------------------+---------------------------------------------------------------+-----------------------+
  35. | :ref:`Vector2i<class_Vector2i>` | :ref:`texture_origin<class_TileData_property_texture_origin>` | ``Vector2i(0, 0)`` |
  36. +---------------------------------+---------------------------------------------------------------+-----------------------+
  37. | :ref:`bool<class_bool>` | :ref:`transpose<class_TileData_property_transpose>` | ``false`` |
  38. +---------------------------------+---------------------------------------------------------------+-----------------------+
  39. | :ref:`int<class_int>` | :ref:`y_sort_origin<class_TileData_property_y_sort_origin>` | ``0`` |
  40. +---------------------------------+---------------------------------------------------------------+-----------------------+
  41. | :ref:`int<class_int>` | :ref:`z_index<class_TileData_property_z_index>` | ``0`` |
  42. +---------------------------------+---------------------------------------------------------------+-----------------------+
  43. .. rst-class:: classref-reftable-group
  44. Methods
  45. -------
  46. .. table::
  47. :widths: auto
  48. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | |void| | :ref:`add_collision_polygon<class_TileData_method_add_collision_polygon>`\ (\ layer_id\: :ref:`int<class_int>`\ ) |
  50. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | |void| | :ref:`add_occluder_polygon<class_TileData_method_add_occluder_polygon>`\ (\ layer_id\: :ref:`int<class_int>`\ ) |
  52. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`float<class_float>` | :ref:`get_collision_polygon_one_way_margin<class_TileData_method_get_collision_polygon_one_way_margin>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) |const| |
  54. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`get_collision_polygon_points<class_TileData_method_get_collision_polygon_points>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) |const| |
  56. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`int<class_int>` | :ref:`get_collision_polygons_count<class_TileData_method_get_collision_polygons_count>`\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| |
  58. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`float<class_float>` | :ref:`get_constant_angular_velocity<class_TileData_method_get_constant_angular_velocity>`\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| |
  60. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`Vector2<class_Vector2>` | :ref:`get_constant_linear_velocity<class_TileData_method_get_constant_linear_velocity>`\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| |
  62. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`Variant<class_Variant>` | :ref:`get_custom_data<class_TileData_method_get_custom_data>`\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| |
  64. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`Variant<class_Variant>` | :ref:`get_custom_data_by_layer_id<class_TileData_method_get_custom_data_by_layer_id>`\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| |
  66. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`NavigationPolygon<class_NavigationPolygon>` | :ref:`get_navigation_polygon<class_TileData_method_get_navigation_polygon>`\ (\ layer_id\: :ref:`int<class_int>`, flip_h\: :ref:`bool<class_bool>` = false, flip_v\: :ref:`bool<class_bool>` = false, transpose\: :ref:`bool<class_bool>` = false\ ) |const| |
  68. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` | :ref:`get_occluder<class_TileData_method_get_occluder>`\ (\ layer_id\: :ref:`int<class_int>`, flip_h\: :ref:`bool<class_bool>` = false, flip_v\: :ref:`bool<class_bool>` = false, transpose\: :ref:`bool<class_bool>` = false\ ) |const| |
  70. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` | :ref:`get_occluder_polygon<class_TileData_method_get_occluder_polygon>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`, flip_h\: :ref:`bool<class_bool>` = false, flip_v\: :ref:`bool<class_bool>` = false, transpose\: :ref:`bool<class_bool>` = false\ ) |const| |
  72. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`int<class_int>` | :ref:`get_occluder_polygons_count<class_TileData_method_get_occluder_polygons_count>`\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| |
  74. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`int<class_int>` | :ref:`get_terrain_peering_bit<class_TileData_method_get_terrain_peering_bit>`\ (\ peering_bit\: :ref:`CellNeighbor<enum_TileSet_CellNeighbor>`\ ) |const| |
  76. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`bool<class_bool>` | :ref:`is_collision_polygon_one_way<class_TileData_method_is_collision_polygon_one_way>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) |const| |
  78. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`bool<class_bool>` | :ref:`is_valid_terrain_peering_bit<class_TileData_method_is_valid_terrain_peering_bit>`\ (\ peering_bit\: :ref:`CellNeighbor<enum_TileSet_CellNeighbor>`\ ) |const| |
  80. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | |void| | :ref:`remove_collision_polygon<class_TileData_method_remove_collision_polygon>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) |
  82. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | |void| | :ref:`remove_occluder_polygon<class_TileData_method_remove_occluder_polygon>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) |
  84. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | |void| | :ref:`set_collision_polygon_one_way<class_TileData_method_set_collision_polygon_one_way>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`, one_way\: :ref:`bool<class_bool>`\ ) |
  86. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | |void| | :ref:`set_collision_polygon_one_way_margin<class_TileData_method_set_collision_polygon_one_way_margin>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`, one_way_margin\: :ref:`float<class_float>`\ ) |
  88. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | |void| | :ref:`set_collision_polygon_points<class_TileData_method_set_collision_polygon_points>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`, polygon\: :ref:`PackedVector2Array<class_PackedVector2Array>`\ ) |
  90. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | |void| | :ref:`set_collision_polygons_count<class_TileData_method_set_collision_polygons_count>`\ (\ layer_id\: :ref:`int<class_int>`, polygons_count\: :ref:`int<class_int>`\ ) |
  92. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | |void| | :ref:`set_constant_angular_velocity<class_TileData_method_set_constant_angular_velocity>`\ (\ layer_id\: :ref:`int<class_int>`, velocity\: :ref:`float<class_float>`\ ) |
  94. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | |void| | :ref:`set_constant_linear_velocity<class_TileData_method_set_constant_linear_velocity>`\ (\ layer_id\: :ref:`int<class_int>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) |
  96. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | |void| | :ref:`set_custom_data<class_TileData_method_set_custom_data>`\ (\ layer_name\: :ref:`String<class_String>`, value\: :ref:`Variant<class_Variant>`\ ) |
  98. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | |void| | :ref:`set_custom_data_by_layer_id<class_TileData_method_set_custom_data_by_layer_id>`\ (\ layer_id\: :ref:`int<class_int>`, value\: :ref:`Variant<class_Variant>`\ ) |
  100. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | |void| | :ref:`set_navigation_polygon<class_TileData_method_set_navigation_polygon>`\ (\ layer_id\: :ref:`int<class_int>`, navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) |
  102. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | |void| | :ref:`set_occluder<class_TileData_method_set_occluder>`\ (\ layer_id\: :ref:`int<class_int>`, occluder_polygon\: :ref:`OccluderPolygon2D<class_OccluderPolygon2D>`\ ) |
  104. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | |void| | :ref:`set_occluder_polygon<class_TileData_method_set_occluder_polygon>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`, polygon\: :ref:`OccluderPolygon2D<class_OccluderPolygon2D>`\ ) |
  106. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | |void| | :ref:`set_occluder_polygons_count<class_TileData_method_set_occluder_polygons_count>`\ (\ layer_id\: :ref:`int<class_int>`, polygons_count\: :ref:`int<class_int>`\ ) |
  108. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | |void| | :ref:`set_terrain_peering_bit<class_TileData_method_set_terrain_peering_bit>`\ (\ peering_bit\: :ref:`CellNeighbor<enum_TileSet_CellNeighbor>`, terrain\: :ref:`int<class_int>`\ ) |
  110. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. .. rst-class:: classref-section-separator
  112. ----
  113. .. rst-class:: classref-descriptions-group
  114. Signals
  115. -------
  116. .. _class_TileData_signal_changed:
  117. .. rst-class:: classref-signal
  118. **changed**\ (\ ) :ref:`๐Ÿ”—<class_TileData_signal_changed>`
  119. Emitted when any of the properties are changed.
  120. .. rst-class:: classref-section-separator
  121. ----
  122. .. rst-class:: classref-descriptions-group
  123. Property Descriptions
  124. ---------------------
  125. .. _class_TileData_property_flip_h:
  126. .. rst-class:: classref-property
  127. :ref:`bool<class_bool>` **flip_h** = ``false`` :ref:`๐Ÿ”—<class_TileData_property_flip_h>`
  128. .. rst-class:: classref-property-setget
  129. - |void| **set_flip_h**\ (\ value\: :ref:`bool<class_bool>`\ )
  130. - :ref:`bool<class_bool>` **get_flip_h**\ (\ )
  131. If ``true``, the tile will have its texture flipped horizontally.
  132. .. rst-class:: classref-item-separator
  133. ----
  134. .. _class_TileData_property_flip_v:
  135. .. rst-class:: classref-property
  136. :ref:`bool<class_bool>` **flip_v** = ``false`` :ref:`๐Ÿ”—<class_TileData_property_flip_v>`
  137. .. rst-class:: classref-property-setget
  138. - |void| **set_flip_v**\ (\ value\: :ref:`bool<class_bool>`\ )
  139. - :ref:`bool<class_bool>` **get_flip_v**\ (\ )
  140. If ``true``, the tile will have its texture flipped vertically.
  141. .. rst-class:: classref-item-separator
  142. ----
  143. .. _class_TileData_property_material:
  144. .. rst-class:: classref-property
  145. :ref:`Material<class_Material>` **material** :ref:`๐Ÿ”—<class_TileData_property_material>`
  146. .. rst-class:: classref-property-setget
  147. - |void| **set_material**\ (\ value\: :ref:`Material<class_Material>`\ )
  148. - :ref:`Material<class_Material>` **get_material**\ (\ )
  149. The :ref:`Material<class_Material>` to use for this **TileData**. This can be a :ref:`CanvasItemMaterial<class_CanvasItemMaterial>` to use the default shader, or a :ref:`ShaderMaterial<class_ShaderMaterial>` to use a custom shader.
  150. .. rst-class:: classref-item-separator
  151. ----
  152. .. _class_TileData_property_modulate:
  153. .. rst-class:: classref-property
  154. :ref:`Color<class_Color>` **modulate** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_TileData_property_modulate>`
  155. .. rst-class:: classref-property-setget
  156. - |void| **set_modulate**\ (\ value\: :ref:`Color<class_Color>`\ )
  157. - :ref:`Color<class_Color>` **get_modulate**\ (\ )
  158. Color modulation of the tile.
  159. .. rst-class:: classref-item-separator
  160. ----
  161. .. _class_TileData_property_probability:
  162. .. rst-class:: classref-property
  163. :ref:`float<class_float>` **probability** = ``1.0`` :ref:`๐Ÿ”—<class_TileData_property_probability>`
  164. .. rst-class:: classref-property-setget
  165. - |void| **set_probability**\ (\ value\: :ref:`float<class_float>`\ )
  166. - :ref:`float<class_float>` **get_probability**\ (\ )
  167. Relative probability of this tile being selected when drawing a pattern of random tiles.
  168. .. rst-class:: classref-item-separator
  169. ----
  170. .. _class_TileData_property_terrain:
  171. .. rst-class:: classref-property
  172. :ref:`int<class_int>` **terrain** = ``-1`` :ref:`๐Ÿ”—<class_TileData_property_terrain>`
  173. .. rst-class:: classref-property-setget
  174. - |void| **set_terrain**\ (\ value\: :ref:`int<class_int>`\ )
  175. - :ref:`int<class_int>` **get_terrain**\ (\ )
  176. ID of the terrain from the terrain set that the tile uses.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_TileData_property_terrain_set:
  180. .. rst-class:: classref-property
  181. :ref:`int<class_int>` **terrain_set** = ``-1`` :ref:`๐Ÿ”—<class_TileData_property_terrain_set>`
  182. .. rst-class:: classref-property-setget
  183. - |void| **set_terrain_set**\ (\ value\: :ref:`int<class_int>`\ )
  184. - :ref:`int<class_int>` **get_terrain_set**\ (\ )
  185. ID of the terrain set that the tile uses.
  186. .. rst-class:: classref-item-separator
  187. ----
  188. .. _class_TileData_property_texture_origin:
  189. .. rst-class:: classref-property
  190. :ref:`Vector2i<class_Vector2i>` **texture_origin** = ``Vector2i(0, 0)`` :ref:`๐Ÿ”—<class_TileData_property_texture_origin>`
  191. .. rst-class:: classref-property-setget
  192. - |void| **set_texture_origin**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
  193. - :ref:`Vector2i<class_Vector2i>` **get_texture_origin**\ (\ )
  194. Offsets the position of where the tile is drawn.
  195. .. rst-class:: classref-item-separator
  196. ----
  197. .. _class_TileData_property_transpose:
  198. .. rst-class:: classref-property
  199. :ref:`bool<class_bool>` **transpose** = ``false`` :ref:`๐Ÿ”—<class_TileData_property_transpose>`
  200. .. rst-class:: classref-property-setget
  201. - |void| **set_transpose**\ (\ value\: :ref:`bool<class_bool>`\ )
  202. - :ref:`bool<class_bool>` **get_transpose**\ (\ )
  203. If ``true``, the tile will display transposed, i.e. with horizontal and vertical texture UVs swapped.
  204. .. rst-class:: classref-item-separator
  205. ----
  206. .. _class_TileData_property_y_sort_origin:
  207. .. rst-class:: classref-property
  208. :ref:`int<class_int>` **y_sort_origin** = ``0`` :ref:`๐Ÿ”—<class_TileData_property_y_sort_origin>`
  209. .. rst-class:: classref-property-setget
  210. - |void| **set_y_sort_origin**\ (\ value\: :ref:`int<class_int>`\ )
  211. - :ref:`int<class_int>` **get_y_sort_origin**\ (\ )
  212. Vertical point of the tile used for determining y-sorted order.
  213. .. rst-class:: classref-item-separator
  214. ----
  215. .. _class_TileData_property_z_index:
  216. .. rst-class:: classref-property
  217. :ref:`int<class_int>` **z_index** = ``0`` :ref:`๐Ÿ”—<class_TileData_property_z_index>`
  218. .. rst-class:: classref-property-setget
  219. - |void| **set_z_index**\ (\ value\: :ref:`int<class_int>`\ )
  220. - :ref:`int<class_int>` **get_z_index**\ (\ )
  221. Ordering index of this tile, relative to :ref:`TileMap<class_TileMap>`.
  222. .. rst-class:: classref-section-separator
  223. ----
  224. .. rst-class:: classref-descriptions-group
  225. Method Descriptions
  226. -------------------
  227. .. _class_TileData_method_add_collision_polygon:
  228. .. rst-class:: classref-method
  229. |void| **add_collision_polygon**\ (\ layer_id\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileData_method_add_collision_polygon>`
  230. Adds a collision polygon to the tile on the given TileSet physics layer.
  231. .. rst-class:: classref-item-separator
  232. ----
  233. .. _class_TileData_method_add_occluder_polygon:
  234. .. rst-class:: classref-method
  235. |void| **add_occluder_polygon**\ (\ layer_id\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileData_method_add_occluder_polygon>`
  236. Adds an occlusion polygon to the tile on the TileSet occlusion layer with index ``layer_id``.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_TileData_method_get_collision_polygon_one_way_margin:
  240. .. rst-class:: classref-method
  241. :ref:`float<class_float>` **get_collision_polygon_one_way_margin**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_collision_polygon_one_way_margin>`
  242. Returns the one-way margin (for one-way platforms) of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  243. .. rst-class:: classref-item-separator
  244. ----
  245. .. _class_TileData_method_get_collision_polygon_points:
  246. .. rst-class:: classref-method
  247. :ref:`PackedVector2Array<class_PackedVector2Array>` **get_collision_polygon_points**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_collision_polygon_points>`
  248. Returns the points of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_TileData_method_get_collision_polygons_count:
  252. .. rst-class:: classref-method
  253. :ref:`int<class_int>` **get_collision_polygons_count**\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_collision_polygons_count>`
  254. Returns how many polygons the tile has for TileSet physics layer with index ``layer_id``.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_TileData_method_get_constant_angular_velocity:
  258. .. rst-class:: classref-method
  259. :ref:`float<class_float>` **get_constant_angular_velocity**\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_constant_angular_velocity>`
  260. Returns the constant angular velocity applied to objects colliding with this tile.
  261. .. rst-class:: classref-item-separator
  262. ----
  263. .. _class_TileData_method_get_constant_linear_velocity:
  264. .. rst-class:: classref-method
  265. :ref:`Vector2<class_Vector2>` **get_constant_linear_velocity**\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_constant_linear_velocity>`
  266. Returns the constant linear velocity applied to objects colliding with this tile.
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_TileData_method_get_custom_data:
  270. .. rst-class:: classref-method
  271. :ref:`Variant<class_Variant>` **get_custom_data**\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_custom_data>`
  272. Returns the custom data value for custom data layer named ``layer_name``.
  273. .. rst-class:: classref-item-separator
  274. ----
  275. .. _class_TileData_method_get_custom_data_by_layer_id:
  276. .. rst-class:: classref-method
  277. :ref:`Variant<class_Variant>` **get_custom_data_by_layer_id**\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_custom_data_by_layer_id>`
  278. Returns the custom data value for custom data layer with index ``layer_id``.
  279. .. rst-class:: classref-item-separator
  280. ----
  281. .. _class_TileData_method_get_navigation_polygon:
  282. .. rst-class:: classref-method
  283. :ref:`NavigationPolygon<class_NavigationPolygon>` **get_navigation_polygon**\ (\ layer_id\: :ref:`int<class_int>`, flip_h\: :ref:`bool<class_bool>` = false, flip_v\: :ref:`bool<class_bool>` = false, transpose\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_navigation_polygon>`
  284. Returns the navigation polygon of the tile for the TileSet navigation layer with index ``layer_id``.
  285. \ ``flip_h``, ``flip_v``, and ``transpose`` allow transforming the returned polygon.
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_TileData_method_get_occluder:
  289. .. rst-class:: classref-method
  290. :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` **get_occluder**\ (\ layer_id\: :ref:`int<class_int>`, flip_h\: :ref:`bool<class_bool>` = false, flip_v\: :ref:`bool<class_bool>` = false, transpose\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_occluder>`
  291. **Deprecated:** Use :ref:`get_occluder_polygon<class_TileData_method_get_occluder_polygon>` instead.
  292. Returns the occluder polygon of the tile for the TileSet occlusion layer with index ``layer_id``.
  293. \ ``flip_h``, ``flip_v``, and ``transpose`` allow transforming the returned polygon.
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_TileData_method_get_occluder_polygon:
  297. .. rst-class:: classref-method
  298. :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` **get_occluder_polygon**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`, flip_h\: :ref:`bool<class_bool>` = false, flip_v\: :ref:`bool<class_bool>` = false, transpose\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_occluder_polygon>`
  299. Returns the occluder polygon at index ``polygon_index`` from the TileSet occlusion layer with index ``layer_id``.
  300. The ``flip_h``, ``flip_v``, and ``transpose`` parameters can be ``true`` to transform the returned polygon.
  301. .. rst-class:: classref-item-separator
  302. ----
  303. .. _class_TileData_method_get_occluder_polygons_count:
  304. .. rst-class:: classref-method
  305. :ref:`int<class_int>` **get_occluder_polygons_count**\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_occluder_polygons_count>`
  306. Returns the number of occluder polygons of the tile in the TileSet occlusion layer with index ``layer_id``.
  307. .. rst-class:: classref-item-separator
  308. ----
  309. .. _class_TileData_method_get_terrain_peering_bit:
  310. .. rst-class:: classref-method
  311. :ref:`int<class_int>` **get_terrain_peering_bit**\ (\ peering_bit\: :ref:`CellNeighbor<enum_TileSet_CellNeighbor>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_get_terrain_peering_bit>`
  312. Returns the tile's terrain bit for the given ``peering_bit`` direction. To check that a direction is valid, use :ref:`is_valid_terrain_peering_bit<class_TileData_method_is_valid_terrain_peering_bit>`.
  313. .. rst-class:: classref-item-separator
  314. ----
  315. .. _class_TileData_method_is_collision_polygon_one_way:
  316. .. rst-class:: classref-method
  317. :ref:`bool<class_bool>` **is_collision_polygon_one_way**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_is_collision_polygon_one_way>`
  318. Returns whether one-way collisions are enabled for the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  319. .. rst-class:: classref-item-separator
  320. ----
  321. .. _class_TileData_method_is_valid_terrain_peering_bit:
  322. .. rst-class:: classref-method
  323. :ref:`bool<class_bool>` **is_valid_terrain_peering_bit**\ (\ peering_bit\: :ref:`CellNeighbor<enum_TileSet_CellNeighbor>`\ ) |const| :ref:`๐Ÿ”—<class_TileData_method_is_valid_terrain_peering_bit>`
  324. Returns whether the given ``peering_bit`` direction is valid for this tile.
  325. .. rst-class:: classref-item-separator
  326. ----
  327. .. _class_TileData_method_remove_collision_polygon:
  328. .. rst-class:: classref-method
  329. |void| **remove_collision_polygon**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileData_method_remove_collision_polygon>`
  330. Removes the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  331. .. rst-class:: classref-item-separator
  332. ----
  333. .. _class_TileData_method_remove_occluder_polygon:
  334. .. rst-class:: classref-method
  335. |void| **remove_occluder_polygon**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileData_method_remove_occluder_polygon>`
  336. Removes the polygon at index ``polygon_index`` for TileSet occlusion layer with index ``layer_id``.
  337. .. rst-class:: classref-item-separator
  338. ----
  339. .. _class_TileData_method_set_collision_polygon_one_way:
  340. .. rst-class:: classref-method
  341. |void| **set_collision_polygon_one_way**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`, one_way\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_collision_polygon_one_way>`
  342. Enables/disables one-way collisions on the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  343. .. rst-class:: classref-item-separator
  344. ----
  345. .. _class_TileData_method_set_collision_polygon_one_way_margin:
  346. .. rst-class:: classref-method
  347. |void| **set_collision_polygon_one_way_margin**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`, one_way_margin\: :ref:`float<class_float>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_collision_polygon_one_way_margin>`
  348. Sets the one-way margin (for one-way platforms) of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  349. .. rst-class:: classref-item-separator
  350. ----
  351. .. _class_TileData_method_set_collision_polygon_points:
  352. .. rst-class:: classref-method
  353. |void| **set_collision_polygon_points**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`, polygon\: :ref:`PackedVector2Array<class_PackedVector2Array>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_collision_polygon_points>`
  354. Sets the points of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  355. .. rst-class:: classref-item-separator
  356. ----
  357. .. _class_TileData_method_set_collision_polygons_count:
  358. .. rst-class:: classref-method
  359. |void| **set_collision_polygons_count**\ (\ layer_id\: :ref:`int<class_int>`, polygons_count\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_collision_polygons_count>`
  360. Sets the polygons count for TileSet physics layer with index ``layer_id``.
  361. .. rst-class:: classref-item-separator
  362. ----
  363. .. _class_TileData_method_set_constant_angular_velocity:
  364. .. rst-class:: classref-method
  365. |void| **set_constant_angular_velocity**\ (\ layer_id\: :ref:`int<class_int>`, velocity\: :ref:`float<class_float>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_constant_angular_velocity>`
  366. Sets the constant angular velocity. This does not rotate the tile. This angular velocity is applied to objects colliding with this tile.
  367. .. rst-class:: classref-item-separator
  368. ----
  369. .. _class_TileData_method_set_constant_linear_velocity:
  370. .. rst-class:: classref-method
  371. |void| **set_constant_linear_velocity**\ (\ layer_id\: :ref:`int<class_int>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_constant_linear_velocity>`
  372. 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.
  373. .. rst-class:: classref-item-separator
  374. ----
  375. .. _class_TileData_method_set_custom_data:
  376. .. rst-class:: classref-method
  377. |void| **set_custom_data**\ (\ layer_name\: :ref:`String<class_String>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_custom_data>`
  378. Sets the tile's custom data value for the TileSet custom data layer with name ``layer_name``.
  379. .. rst-class:: classref-item-separator
  380. ----
  381. .. _class_TileData_method_set_custom_data_by_layer_id:
  382. .. rst-class:: classref-method
  383. |void| **set_custom_data_by_layer_id**\ (\ layer_id\: :ref:`int<class_int>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_custom_data_by_layer_id>`
  384. Sets the tile's custom data value for the TileSet custom data layer with index ``layer_id``.
  385. .. rst-class:: classref-item-separator
  386. ----
  387. .. _class_TileData_method_set_navigation_polygon:
  388. .. rst-class:: classref-method
  389. |void| **set_navigation_polygon**\ (\ layer_id\: :ref:`int<class_int>`, navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_navigation_polygon>`
  390. Sets the navigation polygon for the TileSet navigation layer with index ``layer_id``.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _class_TileData_method_set_occluder:
  394. .. rst-class:: classref-method
  395. |void| **set_occluder**\ (\ layer_id\: :ref:`int<class_int>`, occluder_polygon\: :ref:`OccluderPolygon2D<class_OccluderPolygon2D>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_occluder>`
  396. **Deprecated:** Use :ref:`set_occluder_polygon<class_TileData_method_set_occluder_polygon>` instead.
  397. Sets the occluder for the TileSet occlusion layer with index ``layer_id``.
  398. .. rst-class:: classref-item-separator
  399. ----
  400. .. _class_TileData_method_set_occluder_polygon:
  401. .. rst-class:: classref-method
  402. |void| **set_occluder_polygon**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`, polygon\: :ref:`OccluderPolygon2D<class_OccluderPolygon2D>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_occluder_polygon>`
  403. Sets the occluder for polygon with index ``polygon_index`` in the TileSet occlusion layer with index ``layer_id``.
  404. .. rst-class:: classref-item-separator
  405. ----
  406. .. _class_TileData_method_set_occluder_polygons_count:
  407. .. rst-class:: classref-method
  408. |void| **set_occluder_polygons_count**\ (\ layer_id\: :ref:`int<class_int>`, polygons_count\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_occluder_polygons_count>`
  409. Sets the occluder polygon count in the TileSet occlusion layer with index ``layer_id``.
  410. .. rst-class:: classref-item-separator
  411. ----
  412. .. _class_TileData_method_set_terrain_peering_bit:
  413. .. rst-class:: classref-method
  414. |void| **set_terrain_peering_bit**\ (\ peering_bit\: :ref:`CellNeighbor<enum_TileSet_CellNeighbor>`, terrain\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileData_method_set_terrain_peering_bit>`
  415. Sets the tile's terrain bit for the given ``peering_bit`` direction. To check that a direction is valid, use :ref:`is_valid_terrain_peering_bit<class_TileData_method_is_valid_terrain_peering_bit>`.
  416. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  417. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  418. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  419. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  420. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  421. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  422. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  423. .. |void| replace:: :abbr:`void (No return value.)`