class_tiledata.rst 32 KB

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