class_tilemap.rst 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the TileMap.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_TileMap:
  5. TileMap
  6. =======
  7. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Node for 2D tile-based maps.
  12. Properties
  13. ----------
  14. +--------------------------------------------+-----------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`cell_clip_uv<class_TileMap_cell_clip_uv>` |
  16. +--------------------------------------------+-----------------------------------------------------------------------+
  17. | :ref:`Transform2D<class_Transform2D>` | :ref:`cell_custom_transform<class_TileMap_cell_custom_transform>` |
  18. +--------------------------------------------+-----------------------------------------------------------------------+
  19. | :ref:`HalfOffset<enum_TileMap_HalfOffset>` | :ref:`cell_half_offset<class_TileMap_cell_half_offset>` |
  20. +--------------------------------------------+-----------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`cell_quadrant_size<class_TileMap_cell_quadrant_size>` |
  22. +--------------------------------------------+-----------------------------------------------------------------------+
  23. | :ref:`Vector2<class_Vector2>` | :ref:`cell_size<class_TileMap_cell_size>` |
  24. +--------------------------------------------+-----------------------------------------------------------------------+
  25. | :ref:`TileOrigin<enum_TileMap_TileOrigin>` | :ref:`cell_tile_origin<class_TileMap_cell_tile_origin>` |
  26. +--------------------------------------------+-----------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`cell_y_sort<class_TileMap_cell_y_sort>` |
  28. +--------------------------------------------+-----------------------------------------------------------------------+
  29. | :ref:`float<class_float>` | :ref:`collision_bounce<class_TileMap_collision_bounce>` |
  30. +--------------------------------------------+-----------------------------------------------------------------------+
  31. | :ref:`float<class_float>` | :ref:`collision_friction<class_TileMap_collision_friction>` |
  32. +--------------------------------------------+-----------------------------------------------------------------------+
  33. | :ref:`int<class_int>` | :ref:`collision_layer<class_TileMap_collision_layer>` |
  34. +--------------------------------------------+-----------------------------------------------------------------------+
  35. | :ref:`int<class_int>` | :ref:`collision_mask<class_TileMap_collision_mask>` |
  36. +--------------------------------------------+-----------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`collision_use_kinematic<class_TileMap_collision_use_kinematic>` |
  38. +--------------------------------------------+-----------------------------------------------------------------------+
  39. | :ref:`Mode<enum_TileMap_Mode>` | :ref:`mode<class_TileMap_mode>` |
  40. +--------------------------------------------+-----------------------------------------------------------------------+
  41. | :ref:`int<class_int>` | :ref:`occluder_light_mask<class_TileMap_occluder_light_mask>` |
  42. +--------------------------------------------+-----------------------------------------------------------------------+
  43. | :ref:`TileSet<class_TileSet>` | :ref:`tile_set<class_TileMap_tile_set>` |
  44. +--------------------------------------------+-----------------------------------------------------------------------+
  45. Methods
  46. -------
  47. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | void | :ref:`clear<class_TileMap_clear>` **(** **)** |
  49. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | void | :ref:`fix_invalid_tiles<class_TileMap_fix_invalid_tiles>` **(** **)** |
  51. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`int<class_int>` | :ref:`get_cell<class_TileMap_get_cell>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const |
  53. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Vector2<class_Vector2>` | :ref:`get_cell_autotile_coord<class_TileMap_get_cell_autotile_coord>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const |
  55. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`get_cellv<class_TileMap_get_cellv>` **(** :ref:`Vector2<class_Vector2>` position **)** const |
  57. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`get_collision_layer_bit<class_TileMap_get_collision_layer_bit>` **(** :ref:`int<class_int>` bit **)** const |
  59. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_bit<class_TileMap_get_collision_mask_bit>` **(** :ref:`int<class_int>` bit **)** const |
  61. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`Array<class_Array>` | :ref:`get_used_cells<class_TileMap_get_used_cells>` **(** **)** const |
  63. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Array<class_Array>` | :ref:`get_used_cells_by_id<class_TileMap_get_used_cells_by_id>` **(** :ref:`int<class_int>` id **)** const |
  65. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`Rect2<class_Rect2>` | :ref:`get_used_rect<class_TileMap_get_used_rect>` **(** **)** |
  67. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`bool<class_bool>` | :ref:`is_cell_transposed<class_TileMap_is_cell_transposed>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const |
  69. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`bool<class_bool>` | :ref:`is_cell_x_flipped<class_TileMap_is_cell_x_flipped>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const |
  71. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`bool<class_bool>` | :ref:`is_cell_y_flipped<class_TileMap_is_cell_y_flipped>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const |
  73. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`Vector2<class_Vector2>` | :ref:`map_to_world<class_TileMap_map_to_world>` **(** :ref:`Vector2<class_Vector2>` map_position, :ref:`bool<class_bool>` ignore_half_ofs=false **)** const |
  75. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`set_cell<class_TileMap_set_cell>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` tile, :ref:`bool<class_bool>` flip_x=false, :ref:`bool<class_bool>` flip_y=false, :ref:`bool<class_bool>` transpose=false, :ref:`Vector2<class_Vector2>` autotile_coord=Vector2( 0, 0 ) **)** |
  77. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`set_cellv<class_TileMap_set_cellv>` **(** :ref:`Vector2<class_Vector2>` position, :ref:`int<class_int>` tile, :ref:`bool<class_bool>` flip_x=false, :ref:`bool<class_bool>` flip_y=false, :ref:`bool<class_bool>` transpose=false **)** |
  79. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`set_collision_layer_bit<class_TileMap_set_collision_layer_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  81. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`set_collision_mask_bit<class_TileMap_set_collision_mask_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  83. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`update_bitmask_area<class_TileMap_update_bitmask_area>` **(** :ref:`Vector2<class_Vector2>` position **)** |
  85. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`update_bitmask_region<class_TileMap_update_bitmask_region>` **(** :ref:`Vector2<class_Vector2>` start=Vector2( 0, 0 ), :ref:`Vector2<class_Vector2>` end=Vector2( 0, 0 ) **)** |
  87. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`update_dirty_quadrants<class_TileMap_update_dirty_quadrants>` **(** **)** |
  89. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`Vector2<class_Vector2>` | :ref:`world_to_map<class_TileMap_world_to_map>` **(** :ref:`Vector2<class_Vector2>` world_position **)** const |
  91. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. Signals
  93. -------
  94. .. _class_TileMap_settings_changed:
  95. - **settings_changed** **(** **)**
  96. Emitted when a tilemap setting has changed.
  97. Enumerations
  98. ------------
  99. .. _enum_TileMap_Mode:
  100. enum **Mode**:
  101. - **MODE_SQUARE** = **0** --- Orthogonal orientation mode.
  102. - **MODE_ISOMETRIC** = **1** --- Isometric orientation mode.
  103. - **MODE_CUSTOM** = **2** --- Custom orientation mode.
  104. .. _enum_TileMap_HalfOffset:
  105. enum **HalfOffset**:
  106. - **HALF_OFFSET_X** = **0** --- Half offset on the X coordinate.
  107. - **HALF_OFFSET_Y** = **1** --- Half offset on the Y coordinate.
  108. - **HALF_OFFSET_DISABLED** = **2** --- Half offset disabled.
  109. .. _enum_TileMap_TileOrigin:
  110. enum **TileOrigin**:
  111. - **TILE_ORIGIN_TOP_LEFT** = **0** --- Tile origin at its top-left corner.
  112. - **TILE_ORIGIN_CENTER** = **1** --- Tile origin at its center.
  113. - **TILE_ORIGIN_BOTTOM_LEFT** = **2** --- Tile origin at its bottom-left corner.
  114. Constants
  115. ---------
  116. - **INVALID_CELL** = **-1** --- Returned when a cell doesn't exist.
  117. Description
  118. -----------
  119. Node for 2D tile-based maps. Tilemaps use a :ref:`TileSet<class_TileSet>` which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps.
  120. Tutorials
  121. ---------
  122. - :doc:`../tutorials/2d/using_tilemaps`
  123. Property Descriptions
  124. ---------------------
  125. .. _class_TileMap_cell_clip_uv:
  126. - :ref:`bool<class_bool>` **cell_clip_uv**
  127. +----------+--------------------+
  128. | *Setter* | set_clip_uv(value) |
  129. +----------+--------------------+
  130. | *Getter* | get_clip_uv() |
  131. +----------+--------------------+
  132. .. _class_TileMap_cell_custom_transform:
  133. - :ref:`Transform2D<class_Transform2D>` **cell_custom_transform**
  134. +----------+-----------------------------+
  135. | *Setter* | set_custom_transform(value) |
  136. +----------+-----------------------------+
  137. | *Getter* | get_custom_transform() |
  138. +----------+-----------------------------+
  139. The custom :ref:`Transform2D<class_Transform2D>` to be applied to the TileMap's cells.
  140. .. _class_TileMap_cell_half_offset:
  141. - :ref:`HalfOffset<enum_TileMap_HalfOffset>` **cell_half_offset**
  142. +----------+------------------------+
  143. | *Setter* | set_half_offset(value) |
  144. +----------+------------------------+
  145. | *Getter* | get_half_offset() |
  146. +----------+------------------------+
  147. Amount to offset alternating tiles. Uses HALF_OFFSET\_\* constants. Default value: HALF_OFFSET_DISABLED.
  148. .. _class_TileMap_cell_quadrant_size:
  149. - :ref:`int<class_int>` **cell_quadrant_size**
  150. +----------+--------------------------+
  151. | *Setter* | set_quadrant_size(value) |
  152. +----------+--------------------------+
  153. | *Getter* | get_quadrant_size() |
  154. +----------+--------------------------+
  155. The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. Default value: 16.
  156. .. _class_TileMap_cell_size:
  157. - :ref:`Vector2<class_Vector2>` **cell_size**
  158. +----------+----------------------+
  159. | *Setter* | set_cell_size(value) |
  160. +----------+----------------------+
  161. | *Getter* | get_cell_size() |
  162. +----------+----------------------+
  163. The TileMap's cell size.
  164. .. _class_TileMap_cell_tile_origin:
  165. - :ref:`TileOrigin<enum_TileMap_TileOrigin>` **cell_tile_origin**
  166. +----------+------------------------+
  167. | *Setter* | set_tile_origin(value) |
  168. +----------+------------------------+
  169. | *Getter* | get_tile_origin() |
  170. +----------+------------------------+
  171. Position for tile origin. Uses TILE_ORIGIN\_\* constants. Default value: TILE_ORIGIN_TOP_LEFT.
  172. .. _class_TileMap_cell_y_sort:
  173. - :ref:`bool<class_bool>` **cell_y_sort**
  174. +----------+--------------------------+
  175. | *Setter* | set_y_sort_mode(value) |
  176. +----------+--------------------------+
  177. | *Getter* | is_y_sort_mode_enabled() |
  178. +----------+--------------------------+
  179. If ``true``, the TileMap's children will be drawn in order of their Y coordinate. Default value: ``false``.
  180. .. _class_TileMap_collision_bounce:
  181. - :ref:`float<class_float>` **collision_bounce**
  182. +----------+-----------------------------+
  183. | *Setter* | set_collision_bounce(value) |
  184. +----------+-----------------------------+
  185. | *Getter* | get_collision_bounce() |
  186. +----------+-----------------------------+
  187. Bounce value for static body collisions (see ``collision_use_kinematic``). Default value: 0.
  188. .. _class_TileMap_collision_friction:
  189. - :ref:`float<class_float>` **collision_friction**
  190. +----------+-------------------------------+
  191. | *Setter* | set_collision_friction(value) |
  192. +----------+-------------------------------+
  193. | *Getter* | get_collision_friction() |
  194. +----------+-------------------------------+
  195. Friction value for static body collisions (see ``collision_use_kinematic``). Default value: 1.
  196. .. _class_TileMap_collision_layer:
  197. - :ref:`int<class_int>` **collision_layer**
  198. +----------+----------------------------+
  199. | *Setter* | set_collision_layer(value) |
  200. +----------+----------------------------+
  201. | *Getter* | get_collision_layer() |
  202. +----------+----------------------------+
  203. The collision layer(s) for all colliders in the TileMap.
  204. .. _class_TileMap_collision_mask:
  205. - :ref:`int<class_int>` **collision_mask**
  206. +----------+---------------------------+
  207. | *Setter* | set_collision_mask(value) |
  208. +----------+---------------------------+
  209. | *Getter* | get_collision_mask() |
  210. +----------+---------------------------+
  211. The collision mask(s) for all colliders in the TileMap.
  212. .. _class_TileMap_collision_use_kinematic:
  213. - :ref:`bool<class_bool>` **collision_use_kinematic**
  214. +----------+------------------------------------+
  215. | *Setter* | set_collision_use_kinematic(value) |
  216. +----------+------------------------------------+
  217. | *Getter* | get_collision_use_kinematic() |
  218. +----------+------------------------------------+
  219. If ``true``, TileMap collisions will be handled as a kinematic body. If ``false``, collisions will be handled as static body. Default value: ``false``.
  220. .. _class_TileMap_mode:
  221. - :ref:`Mode<enum_TileMap_Mode>` **mode**
  222. +----------+-----------------+
  223. | *Setter* | set_mode(value) |
  224. +----------+-----------------+
  225. | *Getter* | get_mode() |
  226. +----------+-----------------+
  227. The TileMap orientation mode. Uses MODE\_\* constants. Default value: MODE_SQUARE.
  228. .. _class_TileMap_occluder_light_mask:
  229. - :ref:`int<class_int>` **occluder_light_mask**
  230. +----------+--------------------------------+
  231. | *Setter* | set_occluder_light_mask(value) |
  232. +----------+--------------------------------+
  233. | *Getter* | get_occluder_light_mask() |
  234. +----------+--------------------------------+
  235. The light mask assigned to all light occluders in the TileMap. The TileSet's light occluders will cast shadows only from Light2D(s) that have the same light mask(s).
  236. .. _class_TileMap_tile_set:
  237. - :ref:`TileSet<class_TileSet>` **tile_set**
  238. +----------+--------------------+
  239. | *Setter* | set_tileset(value) |
  240. +----------+--------------------+
  241. | *Getter* | get_tileset() |
  242. +----------+--------------------+
  243. The assigned :ref:`TileSet<class_TileSet>`.
  244. Method Descriptions
  245. -------------------
  246. .. _class_TileMap_clear:
  247. - void **clear** **(** **)**
  248. Clears all cells.
  249. .. _class_TileMap_fix_invalid_tiles:
  250. - void **fix_invalid_tiles** **(** **)**
  251. Clears cells that do not exist in the tileset.
  252. .. _class_TileMap_get_cell:
  253. - :ref:`int<class_int>` **get_cell** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  254. Returns the tile index of the given cell.
  255. .. _class_TileMap_get_cell_autotile_coord:
  256. - :ref:`Vector2<class_Vector2>` **get_cell_autotile_coord** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  257. .. _class_TileMap_get_cellv:
  258. - :ref:`int<class_int>` **get_cellv** **(** :ref:`Vector2<class_Vector2>` position **)** const
  259. Returns the tile index of the cell given by a Vector2.
  260. .. _class_TileMap_get_collision_layer_bit:
  261. - :ref:`bool<class_bool>` **get_collision_layer_bit** **(** :ref:`int<class_int>` bit **)** const
  262. Returns ``true`` if the given collision layer bit is set.
  263. .. _class_TileMap_get_collision_mask_bit:
  264. - :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** const
  265. Returns ``true`` if the given collision mask bit is set.
  266. .. _class_TileMap_get_used_cells:
  267. - :ref:`Array<class_Array>` **get_used_cells** **(** **)** const
  268. Returns a :ref:`Vector2<class_Vector2>` array with the positions of all cells containing a tile from the tileset (i.e. a tile index different from ``-1``).
  269. .. _class_TileMap_get_used_cells_by_id:
  270. - :ref:`Array<class_Array>` **get_used_cells_by_id** **(** :ref:`int<class_int>` id **)** const
  271. Returns an array of all cells with the given tile id.
  272. .. _class_TileMap_get_used_rect:
  273. - :ref:`Rect2<class_Rect2>` **get_used_rect** **(** **)**
  274. Returns a rectangle enclosing the used (non-empty) tiles of the map.
  275. .. _class_TileMap_is_cell_transposed:
  276. - :ref:`bool<class_bool>` **is_cell_transposed** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  277. Returns ``true`` if the given cell is transposed, i.e. the x and y axes are swapped.
  278. .. _class_TileMap_is_cell_x_flipped:
  279. - :ref:`bool<class_bool>` **is_cell_x_flipped** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  280. Returns ``true`` if the given cell is flipped in the x axis.
  281. .. _class_TileMap_is_cell_y_flipped:
  282. - :ref:`bool<class_bool>` **is_cell_y_flipped** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  283. Returns ``true`` if the given cell is flipped in the y axis.
  284. .. _class_TileMap_map_to_world:
  285. - :ref:`Vector2<class_Vector2>` **map_to_world** **(** :ref:`Vector2<class_Vector2>` map_position, :ref:`bool<class_bool>` ignore_half_ofs=false **)** const
  286. Returns the global position corresponding to the given tilemap (grid-based) coordinates.
  287. Optionally, the tilemap's half offset can be ignored.
  288. .. _class_TileMap_set_cell:
  289. - void **set_cell** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` tile, :ref:`bool<class_bool>` flip_x=false, :ref:`bool<class_bool>` flip_y=false, :ref:`bool<class_bool>` transpose=false, :ref:`Vector2<class_Vector2>` autotile_coord=Vector2( 0, 0 ) **)**
  290. Sets the tile index for the cell given by a Vector2.
  291. An index of ``-1`` clears the cell.
  292. Optionally, the tile can also be flipped, transposed, or given autotile coordinates.
  293. Note that data such as navigation polygons and collision shapes are not immediately updated for performance reasons.
  294. If you need these to be immediately updated, you can call :ref:`update_dirty_quadrants<class_TileMap_update_dirty_quadrants>`.
  295. .. _class_TileMap_set_cellv:
  296. - void **set_cellv** **(** :ref:`Vector2<class_Vector2>` position, :ref:`int<class_int>` tile, :ref:`bool<class_bool>` flip_x=false, :ref:`bool<class_bool>` flip_y=false, :ref:`bool<class_bool>` transpose=false **)**
  297. Sets the tile index for the given cell.
  298. An index of ``-1`` clears the cell.
  299. Optionally, the tile can also be flipped or transposed.
  300. Note that data such as navigation polygons and collision shapes are not immediately updated for performance reasons.
  301. If you need these to be immediately updated, you can call :ref:`update_dirty_quadrants<class_TileMap_update_dirty_quadrants>`.
  302. .. _class_TileMap_set_collision_layer_bit:
  303. - void **set_collision_layer_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  304. Sets the given collision layer bit.
  305. .. _class_TileMap_set_collision_mask_bit:
  306. - void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  307. Sets the given collision mask bit.
  308. .. _class_TileMap_update_bitmask_area:
  309. - void **update_bitmask_area** **(** :ref:`Vector2<class_Vector2>` position **)**
  310. Applies autotiling rules to the cell (and its adjacent cells) referenced by its grid-based x and y coordinates.
  311. .. _class_TileMap_update_bitmask_region:
  312. - void **update_bitmask_region** **(** :ref:`Vector2<class_Vector2>` start=Vector2( 0, 0 ), :ref:`Vector2<class_Vector2>` end=Vector2( 0, 0 ) **)**
  313. Applies autotiling rules to the cells in the given region (specified by grid-based x and y coordinates).
  314. Calling with invalid (or missing) parameters applies autotiling rules for the entire tilemap.
  315. .. _class_TileMap_update_dirty_quadrants:
  316. - void **update_dirty_quadrants** **(** **)**
  317. Updates the tile map's quadrants, allowing things such as navigation and collision shapes to be immediately used if modified.
  318. .. _class_TileMap_world_to_map:
  319. - :ref:`Vector2<class_Vector2>` **world_to_map** **(** :ref:`Vector2<class_Vector2>` world_position **)** const
  320. Returns the tilemap (grid-based) coordinatescorresponding to the given global position.