class_tiledata.rst 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  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:`has_custom_data<class_TileData_method_has_custom_data>`\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| |
  78. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :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| |
  80. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :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| |
  82. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | |void| | :ref:`remove_collision_polygon<class_TileData_method_remove_collision_polygon>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) |
  84. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | |void| | :ref:`remove_occluder_polygon<class_TileData_method_remove_occluder_polygon>`\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) |
  86. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | |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>`\ ) |
  88. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | |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>`\ ) |
  90. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | |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>`\ ) |
  92. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | |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>`\ ) |
  94. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | |void| | :ref:`set_constant_angular_velocity<class_TileData_method_set_constant_angular_velocity>`\ (\ layer_id\: :ref:`int<class_int>`, velocity\: :ref:`float<class_float>`\ ) |
  96. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | |void| | :ref:`set_constant_linear_velocity<class_TileData_method_set_constant_linear_velocity>`\ (\ layer_id\: :ref:`int<class_int>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) |
  98. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | |void| | :ref:`set_custom_data<class_TileData_method_set_custom_data>`\ (\ layer_name\: :ref:`String<class_String>`, value\: :ref:`Variant<class_Variant>`\ ) |
  100. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | |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>`\ ) |
  102. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | |void| | :ref:`set_navigation_polygon<class_TileData_method_set_navigation_polygon>`\ (\ layer_id\: :ref:`int<class_int>`, navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) |
  104. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | |void| | :ref:`set_occluder<class_TileData_method_set_occluder>`\ (\ layer_id\: :ref:`int<class_int>`, occluder_polygon\: :ref:`OccluderPolygon2D<class_OccluderPolygon2D>`\ ) |
  106. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | |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>`\ ) |
  108. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | |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>`\ ) |
  110. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | |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>`\ ) |
  112. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. .. rst-class:: classref-section-separator
  114. ----
  115. .. rst-class:: classref-descriptions-group
  116. Signals
  117. -------
  118. .. _class_TileData_signal_changed:
  119. .. rst-class:: classref-signal
  120. **changed**\ (\ ) :ref:`🔗<class_TileData_signal_changed>`
  121. Emitted when any of the properties are changed.
  122. .. rst-class:: classref-section-separator
  123. ----
  124. .. rst-class:: classref-descriptions-group
  125. Property Descriptions
  126. ---------------------
  127. .. _class_TileData_property_flip_h:
  128. .. rst-class:: classref-property
  129. :ref:`bool<class_bool>` **flip_h** = ``false`` :ref:`🔗<class_TileData_property_flip_h>`
  130. .. rst-class:: classref-property-setget
  131. - |void| **set_flip_h**\ (\ value\: :ref:`bool<class_bool>`\ )
  132. - :ref:`bool<class_bool>` **get_flip_h**\ (\ )
  133. If ``true``, the tile will have its texture flipped horizontally.
  134. .. rst-class:: classref-item-separator
  135. ----
  136. .. _class_TileData_property_flip_v:
  137. .. rst-class:: classref-property
  138. :ref:`bool<class_bool>` **flip_v** = ``false`` :ref:`🔗<class_TileData_property_flip_v>`
  139. .. rst-class:: classref-property-setget
  140. - |void| **set_flip_v**\ (\ value\: :ref:`bool<class_bool>`\ )
  141. - :ref:`bool<class_bool>` **get_flip_v**\ (\ )
  142. If ``true``, the tile will have its texture flipped vertically.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _class_TileData_property_material:
  146. .. rst-class:: classref-property
  147. :ref:`Material<class_Material>` **material** :ref:`🔗<class_TileData_property_material>`
  148. .. rst-class:: classref-property-setget
  149. - |void| **set_material**\ (\ value\: :ref:`Material<class_Material>`\ )
  150. - :ref:`Material<class_Material>` **get_material**\ (\ )
  151. 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.
  152. .. rst-class:: classref-item-separator
  153. ----
  154. .. _class_TileData_property_modulate:
  155. .. rst-class:: classref-property
  156. :ref:`Color<class_Color>` **modulate** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_TileData_property_modulate>`
  157. .. rst-class:: classref-property-setget
  158. - |void| **set_modulate**\ (\ value\: :ref:`Color<class_Color>`\ )
  159. - :ref:`Color<class_Color>` **get_modulate**\ (\ )
  160. Color modulation of the tile.
  161. .. rst-class:: classref-item-separator
  162. ----
  163. .. _class_TileData_property_probability:
  164. .. rst-class:: classref-property
  165. :ref:`float<class_float>` **probability** = ``1.0`` :ref:`🔗<class_TileData_property_probability>`
  166. .. rst-class:: classref-property-setget
  167. - |void| **set_probability**\ (\ value\: :ref:`float<class_float>`\ )
  168. - :ref:`float<class_float>` **get_probability**\ (\ )
  169. Relative probability of this tile being selected when drawing a pattern of random tiles.
  170. .. rst-class:: classref-item-separator
  171. ----
  172. .. _class_TileData_property_terrain:
  173. .. rst-class:: classref-property
  174. :ref:`int<class_int>` **terrain** = ``-1`` :ref:`🔗<class_TileData_property_terrain>`
  175. .. rst-class:: classref-property-setget
  176. - |void| **set_terrain**\ (\ value\: :ref:`int<class_int>`\ )
  177. - :ref:`int<class_int>` **get_terrain**\ (\ )
  178. ID of the terrain from the terrain set that the tile uses.
  179. .. rst-class:: classref-item-separator
  180. ----
  181. .. _class_TileData_property_terrain_set:
  182. .. rst-class:: classref-property
  183. :ref:`int<class_int>` **terrain_set** = ``-1`` :ref:`🔗<class_TileData_property_terrain_set>`
  184. .. rst-class:: classref-property-setget
  185. - |void| **set_terrain_set**\ (\ value\: :ref:`int<class_int>`\ )
  186. - :ref:`int<class_int>` **get_terrain_set**\ (\ )
  187. ID of the terrain set that the tile uses.
  188. .. rst-class:: classref-item-separator
  189. ----
  190. .. _class_TileData_property_texture_origin:
  191. .. rst-class:: classref-property
  192. :ref:`Vector2i<class_Vector2i>` **texture_origin** = ``Vector2i(0, 0)`` :ref:`🔗<class_TileData_property_texture_origin>`
  193. .. rst-class:: classref-property-setget
  194. - |void| **set_texture_origin**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
  195. - :ref:`Vector2i<class_Vector2i>` **get_texture_origin**\ (\ )
  196. Offsets the position of where the tile is drawn.
  197. .. rst-class:: classref-item-separator
  198. ----
  199. .. _class_TileData_property_transpose:
  200. .. rst-class:: classref-property
  201. :ref:`bool<class_bool>` **transpose** = ``false`` :ref:`🔗<class_TileData_property_transpose>`
  202. .. rst-class:: classref-property-setget
  203. - |void| **set_transpose**\ (\ value\: :ref:`bool<class_bool>`\ )
  204. - :ref:`bool<class_bool>` **get_transpose**\ (\ )
  205. If ``true``, the tile will display transposed, i.e. with horizontal and vertical texture UVs swapped.
  206. .. rst-class:: classref-item-separator
  207. ----
  208. .. _class_TileData_property_y_sort_origin:
  209. .. rst-class:: classref-property
  210. :ref:`int<class_int>` **y_sort_origin** = ``0`` :ref:`🔗<class_TileData_property_y_sort_origin>`
  211. .. rst-class:: classref-property-setget
  212. - |void| **set_y_sort_origin**\ (\ value\: :ref:`int<class_int>`\ )
  213. - :ref:`int<class_int>` **get_y_sort_origin**\ (\ )
  214. Vertical point of the tile used for determining y-sorted order.
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_TileData_property_z_index:
  218. .. rst-class:: classref-property
  219. :ref:`int<class_int>` **z_index** = ``0`` :ref:`🔗<class_TileData_property_z_index>`
  220. .. rst-class:: classref-property-setget
  221. - |void| **set_z_index**\ (\ value\: :ref:`int<class_int>`\ )
  222. - :ref:`int<class_int>` **get_z_index**\ (\ )
  223. Ordering index of this tile, relative to :ref:`TileMap<class_TileMap>`.
  224. .. rst-class:: classref-section-separator
  225. ----
  226. .. rst-class:: classref-descriptions-group
  227. Method Descriptions
  228. -------------------
  229. .. _class_TileData_method_add_collision_polygon:
  230. .. rst-class:: classref-method
  231. |void| **add_collision_polygon**\ (\ layer_id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileData_method_add_collision_polygon>`
  232. Adds a collision polygon to the tile on the given TileSet physics layer.
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_TileData_method_add_occluder_polygon:
  236. .. rst-class:: classref-method
  237. |void| **add_occluder_polygon**\ (\ layer_id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileData_method_add_occluder_polygon>`
  238. Adds an occlusion polygon to the tile on the TileSet occlusion layer with index ``layer_id``.
  239. .. rst-class:: classref-item-separator
  240. ----
  241. .. _class_TileData_method_get_collision_polygon_one_way_margin:
  242. .. rst-class:: classref-method
  243. :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>`
  244. Returns the one-way margin (for one-way platforms) of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  245. .. rst-class:: classref-item-separator
  246. ----
  247. .. _class_TileData_method_get_collision_polygon_points:
  248. .. rst-class:: classref-method
  249. :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>`
  250. Returns the points of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  251. .. rst-class:: classref-item-separator
  252. ----
  253. .. _class_TileData_method_get_collision_polygons_count:
  254. .. rst-class:: classref-method
  255. :ref:`int<class_int>` **get_collision_polygons_count**\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileData_method_get_collision_polygons_count>`
  256. Returns how many polygons the tile has for TileSet physics layer with index ``layer_id``.
  257. .. rst-class:: classref-item-separator
  258. ----
  259. .. _class_TileData_method_get_constant_angular_velocity:
  260. .. rst-class:: classref-method
  261. :ref:`float<class_float>` **get_constant_angular_velocity**\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileData_method_get_constant_angular_velocity>`
  262. Returns the constant angular velocity applied to objects colliding with this tile.
  263. .. rst-class:: classref-item-separator
  264. ----
  265. .. _class_TileData_method_get_constant_linear_velocity:
  266. .. rst-class:: classref-method
  267. :ref:`Vector2<class_Vector2>` **get_constant_linear_velocity**\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileData_method_get_constant_linear_velocity>`
  268. Returns the constant linear velocity applied to objects colliding with this tile.
  269. .. rst-class:: classref-item-separator
  270. ----
  271. .. _class_TileData_method_get_custom_data:
  272. .. rst-class:: classref-method
  273. :ref:`Variant<class_Variant>` **get_custom_data**\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_TileData_method_get_custom_data>`
  274. Returns the custom data value for custom data layer named ``layer_name``. To check if a custom data layer exists, use :ref:`has_custom_data()<class_TileData_method_has_custom_data>`.
  275. .. rst-class:: classref-item-separator
  276. ----
  277. .. _class_TileData_method_get_custom_data_by_layer_id:
  278. .. rst-class:: classref-method
  279. :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>`
  280. Returns the custom data value for custom data layer with index ``layer_id``.
  281. .. rst-class:: classref-item-separator
  282. ----
  283. .. _class_TileData_method_get_navigation_polygon:
  284. .. rst-class:: classref-method
  285. :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>`
  286. Returns the navigation polygon of the tile for the TileSet navigation layer with index ``layer_id``.
  287. \ ``flip_h``, ``flip_v``, and ``transpose`` allow transforming the returned polygon.
  288. .. rst-class:: classref-item-separator
  289. ----
  290. .. _class_TileData_method_get_occluder:
  291. .. rst-class:: classref-method
  292. :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>`
  293. **Deprecated:** Use :ref:`get_occluder_polygon()<class_TileData_method_get_occluder_polygon>` instead.
  294. Returns the occluder polygon of the tile for the TileSet occlusion layer with index ``layer_id``.
  295. \ ``flip_h``, ``flip_v``, and ``transpose`` allow transforming the returned polygon.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_TileData_method_get_occluder_polygon:
  299. .. rst-class:: classref-method
  300. :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>`
  301. Returns the occluder polygon at index ``polygon_index`` from the TileSet occlusion layer with index ``layer_id``.
  302. The ``flip_h``, ``flip_v``, and ``transpose`` parameters can be ``true`` to transform the returned polygon.
  303. .. rst-class:: classref-item-separator
  304. ----
  305. .. _class_TileData_method_get_occluder_polygons_count:
  306. .. rst-class:: classref-method
  307. :ref:`int<class_int>` **get_occluder_polygons_count**\ (\ layer_id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileData_method_get_occluder_polygons_count>`
  308. Returns the number of occluder polygons of the tile in the TileSet occlusion layer with index ``layer_id``.
  309. .. rst-class:: classref-item-separator
  310. ----
  311. .. _class_TileData_method_get_terrain_peering_bit:
  312. .. rst-class:: classref-method
  313. :ref:`int<class_int>` **get_terrain_peering_bit**\ (\ peering_bit\: :ref:`CellNeighbor<enum_TileSet_CellNeighbor>`\ ) |const| :ref:`🔗<class_TileData_method_get_terrain_peering_bit>`
  314. 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>`.
  315. .. rst-class:: classref-item-separator
  316. ----
  317. .. _class_TileData_method_has_custom_data:
  318. .. rst-class:: classref-method
  319. :ref:`bool<class_bool>` **has_custom_data**\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_TileData_method_has_custom_data>`
  320. Returns whether there exists a custom data layer named ``layer_name``.
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _class_TileData_method_is_collision_polygon_one_way:
  324. .. rst-class:: classref-method
  325. :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>`
  326. Returns whether one-way collisions are enabled for the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  327. .. rst-class:: classref-item-separator
  328. ----
  329. .. _class_TileData_method_is_valid_terrain_peering_bit:
  330. .. rst-class:: classref-method
  331. :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>`
  332. Returns whether the given ``peering_bit`` direction is valid for this tile.
  333. .. rst-class:: classref-item-separator
  334. ----
  335. .. _class_TileData_method_remove_collision_polygon:
  336. .. rst-class:: classref-method
  337. |void| **remove_collision_polygon**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileData_method_remove_collision_polygon>`
  338. Removes the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  339. .. rst-class:: classref-item-separator
  340. ----
  341. .. _class_TileData_method_remove_occluder_polygon:
  342. .. rst-class:: classref-method
  343. |void| **remove_occluder_polygon**\ (\ layer_id\: :ref:`int<class_int>`, polygon_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileData_method_remove_occluder_polygon>`
  344. Removes the polygon at index ``polygon_index`` for TileSet occlusion layer with index ``layer_id``.
  345. .. rst-class:: classref-item-separator
  346. ----
  347. .. _class_TileData_method_set_collision_polygon_one_way:
  348. .. rst-class:: classref-method
  349. |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>`
  350. Enables/disables one-way collisions on the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  351. .. rst-class:: classref-item-separator
  352. ----
  353. .. _class_TileData_method_set_collision_polygon_one_way_margin:
  354. .. rst-class:: classref-method
  355. |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>`
  356. Sets the one-way margin (for one-way platforms) of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  357. .. rst-class:: classref-item-separator
  358. ----
  359. .. _class_TileData_method_set_collision_polygon_points:
  360. .. rst-class:: classref-method
  361. |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>`
  362. Sets the points of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
  363. .. rst-class:: classref-item-separator
  364. ----
  365. .. _class_TileData_method_set_collision_polygons_count:
  366. .. rst-class:: classref-method
  367. |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>`
  368. Sets the polygons count for TileSet physics layer with index ``layer_id``.
  369. .. rst-class:: classref-item-separator
  370. ----
  371. .. _class_TileData_method_set_constant_angular_velocity:
  372. .. rst-class:: classref-method
  373. |void| **set_constant_angular_velocity**\ (\ layer_id\: :ref:`int<class_int>`, velocity\: :ref:`float<class_float>`\ ) :ref:`🔗<class_TileData_method_set_constant_angular_velocity>`
  374. Sets the constant angular velocity. This does not rotate the tile. This angular velocity is applied to objects colliding with this tile.
  375. .. rst-class:: classref-item-separator
  376. ----
  377. .. _class_TileData_method_set_constant_linear_velocity:
  378. .. rst-class:: classref-method
  379. |void| **set_constant_linear_velocity**\ (\ layer_id\: :ref:`int<class_int>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_TileData_method_set_constant_linear_velocity>`
  380. 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.
  381. .. rst-class:: classref-item-separator
  382. ----
  383. .. _class_TileData_method_set_custom_data:
  384. .. rst-class:: classref-method
  385. |void| **set_custom_data**\ (\ layer_name\: :ref:`String<class_String>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_TileData_method_set_custom_data>`
  386. Sets the tile's custom data value for the TileSet custom data layer with name ``layer_name``.
  387. .. rst-class:: classref-item-separator
  388. ----
  389. .. _class_TileData_method_set_custom_data_by_layer_id:
  390. .. rst-class:: classref-method
  391. |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>`
  392. Sets the tile's custom data value for the TileSet custom data layer with index ``layer_id``.
  393. .. rst-class:: classref-item-separator
  394. ----
  395. .. _class_TileData_method_set_navigation_polygon:
  396. .. rst-class:: classref-method
  397. |void| **set_navigation_polygon**\ (\ layer_id\: :ref:`int<class_int>`, navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) :ref:`🔗<class_TileData_method_set_navigation_polygon>`
  398. Sets the navigation polygon for the TileSet navigation layer with index ``layer_id``.
  399. .. rst-class:: classref-item-separator
  400. ----
  401. .. _class_TileData_method_set_occluder:
  402. .. rst-class:: classref-method
  403. |void| **set_occluder**\ (\ layer_id\: :ref:`int<class_int>`, occluder_polygon\: :ref:`OccluderPolygon2D<class_OccluderPolygon2D>`\ ) :ref:`🔗<class_TileData_method_set_occluder>`
  404. **Deprecated:** Use :ref:`set_occluder_polygon()<class_TileData_method_set_occluder_polygon>` instead.
  405. Sets the occluder for the TileSet occlusion layer with index ``layer_id``.
  406. .. rst-class:: classref-item-separator
  407. ----
  408. .. _class_TileData_method_set_occluder_polygon:
  409. .. rst-class:: classref-method
  410. |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>`
  411. Sets the occluder for polygon with index ``polygon_index`` in the TileSet occlusion layer with index ``layer_id``.
  412. .. rst-class:: classref-item-separator
  413. ----
  414. .. _class_TileData_method_set_occluder_polygons_count:
  415. .. rst-class:: classref-method
  416. |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>`
  417. Sets the occluder polygon count in the TileSet occlusion layer with index ``layer_id``.
  418. .. rst-class:: classref-item-separator
  419. ----
  420. .. _class_TileData_method_set_terrain_peering_bit:
  421. .. rst-class:: classref-method
  422. |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>`
  423. 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>`.
  424. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  425. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  426. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  427. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  428. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  429. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  430. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  431. .. |void| replace:: :abbr:`void (No return value.)`