class_tiledata.rst 37 KB

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