class_tilemap.rst 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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_property_cell_clip_uv>` |
  16. +--------------------------------------------+--------------------------------------------------------------------------------+
  17. | :ref:`Transform2D<class_Transform2D>` | :ref:`cell_custom_transform<class_TileMap_property_cell_custom_transform>` |
  18. +--------------------------------------------+--------------------------------------------------------------------------------+
  19. | :ref:`HalfOffset<enum_TileMap_HalfOffset>` | :ref:`cell_half_offset<class_TileMap_property_cell_half_offset>` |
  20. +--------------------------------------------+--------------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`cell_quadrant_size<class_TileMap_property_cell_quadrant_size>` |
  22. +--------------------------------------------+--------------------------------------------------------------------------------+
  23. | :ref:`Vector2<class_Vector2>` | :ref:`cell_size<class_TileMap_property_cell_size>` |
  24. +--------------------------------------------+--------------------------------------------------------------------------------+
  25. | :ref:`TileOrigin<enum_TileMap_TileOrigin>` | :ref:`cell_tile_origin<class_TileMap_property_cell_tile_origin>` |
  26. +--------------------------------------------+--------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`cell_y_sort<class_TileMap_property_cell_y_sort>` |
  28. +--------------------------------------------+--------------------------------------------------------------------------------+
  29. | :ref:`float<class_float>` | :ref:`collision_bounce<class_TileMap_property_collision_bounce>` |
  30. +--------------------------------------------+--------------------------------------------------------------------------------+
  31. | :ref:`float<class_float>` | :ref:`collision_friction<class_TileMap_property_collision_friction>` |
  32. +--------------------------------------------+--------------------------------------------------------------------------------+
  33. | :ref:`int<class_int>` | :ref:`collision_layer<class_TileMap_property_collision_layer>` |
  34. +--------------------------------------------+--------------------------------------------------------------------------------+
  35. | :ref:`int<class_int>` | :ref:`collision_mask<class_TileMap_property_collision_mask>` |
  36. +--------------------------------------------+--------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`collision_use_kinematic<class_TileMap_property_collision_use_kinematic>` |
  38. +--------------------------------------------+--------------------------------------------------------------------------------+
  39. | :ref:`Mode<enum_TileMap_Mode>` | :ref:`mode<class_TileMap_property_mode>` |
  40. +--------------------------------------------+--------------------------------------------------------------------------------+
  41. | :ref:`int<class_int>` | :ref:`occluder_light_mask<class_TileMap_property_occluder_light_mask>` |
  42. +--------------------------------------------+--------------------------------------------------------------------------------+
  43. | :ref:`TileSet<class_TileSet>` | :ref:`tile_set<class_TileMap_property_tile_set>` |
  44. +--------------------------------------------+--------------------------------------------------------------------------------+
  45. Methods
  46. -------
  47. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | void | :ref:`clear<class_TileMap_method_clear>` **(** **)** |
  49. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | void | :ref:`fix_invalid_tiles<class_TileMap_method_fix_invalid_tiles>` **(** **)** |
  51. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`int<class_int>` | :ref:`get_cell<class_TileMap_method_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_method_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_method_get_cellv>` **(** :ref:`Vector2<class_Vector2>` position **)** const |
  57. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`get_collision_layer_bit<class_TileMap_method_get_collision_layer_bit>` **(** :ref:`int<class_int>` bit **)** const |
  59. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_bit<class_TileMap_method_get_collision_mask_bit>` **(** :ref:`int<class_int>` bit **)** const |
  61. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`Array<class_Array>` | :ref:`get_used_cells<class_TileMap_method_get_used_cells>` **(** **)** const |
  63. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Array<class_Array>` | :ref:`get_used_cells_by_id<class_TileMap_method_get_used_cells_by_id>` **(** :ref:`int<class_int>` id **)** const |
  65. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`Rect2<class_Rect2>` | :ref:`get_used_rect<class_TileMap_method_get_used_rect>` **(** **)** |
  67. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`bool<class_bool>` | :ref:`is_cell_transposed<class_TileMap_method_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_method_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_method_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_method_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_method_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_method_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_method_set_collision_layer_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  81. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`set_collision_mask_bit<class_TileMap_method_set_collision_mask_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  83. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`update_bitmask_area<class_TileMap_method_update_bitmask_area>` **(** :ref:`Vector2<class_Vector2>` position **)** |
  85. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`update_bitmask_region<class_TileMap_method_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_method_update_dirty_quadrants>` **(** **)** |
  89. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`Vector2<class_Vector2>` | :ref:`world_to_map<class_TileMap_method_world_to_map>` **(** :ref:`Vector2<class_Vector2>` world_position **)** const |
  91. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. Signals
  93. -------
  94. .. _class_TileMap_signal_settings_changed:
  95. - **settings_changed** **(** **)**
  96. Emitted when a tilemap setting has changed.
  97. Enumerations
  98. ------------
  99. .. _enum_TileMap_Mode:
  100. .. _class_TileMap_constant_MODE_SQUARE:
  101. .. _class_TileMap_constant_MODE_ISOMETRIC:
  102. .. _class_TileMap_constant_MODE_CUSTOM:
  103. enum **Mode**:
  104. - **MODE_SQUARE** = **0** --- Orthogonal orientation mode.
  105. - **MODE_ISOMETRIC** = **1** --- Isometric orientation mode.
  106. - **MODE_CUSTOM** = **2** --- Custom orientation mode.
  107. .. _enum_TileMap_HalfOffset:
  108. .. _class_TileMap_constant_HALF_OFFSET_X:
  109. .. _class_TileMap_constant_HALF_OFFSET_Y:
  110. .. _class_TileMap_constant_HALF_OFFSET_DISABLED:
  111. enum **HalfOffset**:
  112. - **HALF_OFFSET_X** = **0** --- Half offset on the X coordinate.
  113. - **HALF_OFFSET_Y** = **1** --- Half offset on the Y coordinate.
  114. - **HALF_OFFSET_DISABLED** = **2** --- Half offset disabled.
  115. .. _enum_TileMap_TileOrigin:
  116. .. _class_TileMap_constant_TILE_ORIGIN_TOP_LEFT:
  117. .. _class_TileMap_constant_TILE_ORIGIN_CENTER:
  118. .. _class_TileMap_constant_TILE_ORIGIN_BOTTOM_LEFT:
  119. enum **TileOrigin**:
  120. - **TILE_ORIGIN_TOP_LEFT** = **0** --- Tile origin at its top-left corner.
  121. - **TILE_ORIGIN_CENTER** = **1** --- Tile origin at its center.
  122. - **TILE_ORIGIN_BOTTOM_LEFT** = **2** --- Tile origin at its bottom-left corner.
  123. Constants
  124. ---------
  125. .. _class_TileMap_constant_INVALID_CELL:
  126. - **INVALID_CELL** = **-1** --- Returned when a cell doesn't exist.
  127. Description
  128. -----------
  129. 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.
  130. Tutorials
  131. ---------
  132. - :doc:`../tutorials/2d/using_tilemaps`
  133. Property Descriptions
  134. ---------------------
  135. .. _class_TileMap_property_cell_clip_uv:
  136. - :ref:`bool<class_bool>` **cell_clip_uv**
  137. +----------+--------------------+
  138. | *Setter* | set_clip_uv(value) |
  139. +----------+--------------------+
  140. | *Getter* | get_clip_uv() |
  141. +----------+--------------------+
  142. .. _class_TileMap_property_cell_custom_transform:
  143. - :ref:`Transform2D<class_Transform2D>` **cell_custom_transform**
  144. +----------+-----------------------------+
  145. | *Setter* | set_custom_transform(value) |
  146. +----------+-----------------------------+
  147. | *Getter* | get_custom_transform() |
  148. +----------+-----------------------------+
  149. The custom :ref:`Transform2D<class_Transform2D>` to be applied to the TileMap's cells.
  150. .. _class_TileMap_property_cell_half_offset:
  151. - :ref:`HalfOffset<enum_TileMap_HalfOffset>` **cell_half_offset**
  152. +----------+------------------------+
  153. | *Setter* | set_half_offset(value) |
  154. +----------+------------------------+
  155. | *Getter* | get_half_offset() |
  156. +----------+------------------------+
  157. Amount to offset alternating tiles. Uses HALF_OFFSET\_\* constants. Default value: HALF_OFFSET_DISABLED.
  158. .. _class_TileMap_property_cell_quadrant_size:
  159. - :ref:`int<class_int>` **cell_quadrant_size**
  160. +----------+--------------------------+
  161. | *Setter* | set_quadrant_size(value) |
  162. +----------+--------------------------+
  163. | *Getter* | get_quadrant_size() |
  164. +----------+--------------------------+
  165. The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. Default value: 16.
  166. .. _class_TileMap_property_cell_size:
  167. - :ref:`Vector2<class_Vector2>` **cell_size**
  168. +----------+----------------------+
  169. | *Setter* | set_cell_size(value) |
  170. +----------+----------------------+
  171. | *Getter* | get_cell_size() |
  172. +----------+----------------------+
  173. The TileMap's cell size.
  174. .. _class_TileMap_property_cell_tile_origin:
  175. - :ref:`TileOrigin<enum_TileMap_TileOrigin>` **cell_tile_origin**
  176. +----------+------------------------+
  177. | *Setter* | set_tile_origin(value) |
  178. +----------+------------------------+
  179. | *Getter* | get_tile_origin() |
  180. +----------+------------------------+
  181. Position for tile origin. Uses TILE_ORIGIN\_\* constants. Default value: TILE_ORIGIN_TOP_LEFT.
  182. .. _class_TileMap_property_cell_y_sort:
  183. - :ref:`bool<class_bool>` **cell_y_sort**
  184. +----------+--------------------------+
  185. | *Setter* | set_y_sort_mode(value) |
  186. +----------+--------------------------+
  187. | *Getter* | is_y_sort_mode_enabled() |
  188. +----------+--------------------------+
  189. If ``true``, the TileMap's children will be drawn in order of their Y coordinate. Default value: ``false``.
  190. .. _class_TileMap_property_collision_bounce:
  191. - :ref:`float<class_float>` **collision_bounce**
  192. +----------+-----------------------------+
  193. | *Setter* | set_collision_bounce(value) |
  194. +----------+-----------------------------+
  195. | *Getter* | get_collision_bounce() |
  196. +----------+-----------------------------+
  197. Bounce value for static body collisions (see ``collision_use_kinematic``). Default value: 0.
  198. .. _class_TileMap_property_collision_friction:
  199. - :ref:`float<class_float>` **collision_friction**
  200. +----------+-------------------------------+
  201. | *Setter* | set_collision_friction(value) |
  202. +----------+-------------------------------+
  203. | *Getter* | get_collision_friction() |
  204. +----------+-------------------------------+
  205. Friction value for static body collisions (see ``collision_use_kinematic``). Default value: 1.
  206. .. _class_TileMap_property_collision_layer:
  207. - :ref:`int<class_int>` **collision_layer**
  208. +----------+----------------------------+
  209. | *Setter* | set_collision_layer(value) |
  210. +----------+----------------------------+
  211. | *Getter* | get_collision_layer() |
  212. +----------+----------------------------+
  213. The collision layer(s) for all colliders in the TileMap.
  214. .. _class_TileMap_property_collision_mask:
  215. - :ref:`int<class_int>` **collision_mask**
  216. +----------+---------------------------+
  217. | *Setter* | set_collision_mask(value) |
  218. +----------+---------------------------+
  219. | *Getter* | get_collision_mask() |
  220. +----------+---------------------------+
  221. The collision mask(s) for all colliders in the TileMap.
  222. .. _class_TileMap_property_collision_use_kinematic:
  223. - :ref:`bool<class_bool>` **collision_use_kinematic**
  224. +----------+------------------------------------+
  225. | *Setter* | set_collision_use_kinematic(value) |
  226. +----------+------------------------------------+
  227. | *Getter* | get_collision_use_kinematic() |
  228. +----------+------------------------------------+
  229. If ``true``, TileMap collisions will be handled as a kinematic body. If ``false``, collisions will be handled as static body. Default value: ``false``.
  230. .. _class_TileMap_property_mode:
  231. - :ref:`Mode<enum_TileMap_Mode>` **mode**
  232. +----------+-----------------+
  233. | *Setter* | set_mode(value) |
  234. +----------+-----------------+
  235. | *Getter* | get_mode() |
  236. +----------+-----------------+
  237. The TileMap orientation mode. Uses MODE\_\* constants. Default value: MODE_SQUARE.
  238. .. _class_TileMap_property_occluder_light_mask:
  239. - :ref:`int<class_int>` **occluder_light_mask**
  240. +----------+--------------------------------+
  241. | *Setter* | set_occluder_light_mask(value) |
  242. +----------+--------------------------------+
  243. | *Getter* | get_occluder_light_mask() |
  244. +----------+--------------------------------+
  245. 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).
  246. .. _class_TileMap_property_tile_set:
  247. - :ref:`TileSet<class_TileSet>` **tile_set**
  248. +----------+--------------------+
  249. | *Setter* | set_tileset(value) |
  250. +----------+--------------------+
  251. | *Getter* | get_tileset() |
  252. +----------+--------------------+
  253. The assigned :ref:`TileSet<class_TileSet>`.
  254. Method Descriptions
  255. -------------------
  256. .. _class_TileMap_method_clear:
  257. - void **clear** **(** **)**
  258. Clears all cells.
  259. .. _class_TileMap_method_fix_invalid_tiles:
  260. - void **fix_invalid_tiles** **(** **)**
  261. Clears cells that do not exist in the tileset.
  262. .. _class_TileMap_method_get_cell:
  263. - :ref:`int<class_int>` **get_cell** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  264. Returns the tile index of the given cell.
  265. .. _class_TileMap_method_get_cell_autotile_coord:
  266. - :ref:`Vector2<class_Vector2>` **get_cell_autotile_coord** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  267. .. _class_TileMap_method_get_cellv:
  268. - :ref:`int<class_int>` **get_cellv** **(** :ref:`Vector2<class_Vector2>` position **)** const
  269. Returns the tile index of the cell given by a Vector2.
  270. .. _class_TileMap_method_get_collision_layer_bit:
  271. - :ref:`bool<class_bool>` **get_collision_layer_bit** **(** :ref:`int<class_int>` bit **)** const
  272. Returns ``true`` if the given collision layer bit is set.
  273. .. _class_TileMap_method_get_collision_mask_bit:
  274. - :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** const
  275. Returns ``true`` if the given collision mask bit is set.
  276. .. _class_TileMap_method_get_used_cells:
  277. - :ref:`Array<class_Array>` **get_used_cells** **(** **)** const
  278. 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``).
  279. .. _class_TileMap_method_get_used_cells_by_id:
  280. - :ref:`Array<class_Array>` **get_used_cells_by_id** **(** :ref:`int<class_int>` id **)** const
  281. Returns an array of all cells with the given tile id.
  282. .. _class_TileMap_method_get_used_rect:
  283. - :ref:`Rect2<class_Rect2>` **get_used_rect** **(** **)**
  284. Returns a rectangle enclosing the used (non-empty) tiles of the map.
  285. .. _class_TileMap_method_is_cell_transposed:
  286. - :ref:`bool<class_bool>` **is_cell_transposed** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  287. Returns ``true`` if the given cell is transposed, i.e. the x and y axes are swapped.
  288. .. _class_TileMap_method_is_cell_x_flipped:
  289. - :ref:`bool<class_bool>` **is_cell_x_flipped** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  290. Returns ``true`` if the given cell is flipped in the x axis.
  291. .. _class_TileMap_method_is_cell_y_flipped:
  292. - :ref:`bool<class_bool>` **is_cell_y_flipped** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  293. Returns ``true`` if the given cell is flipped in the y axis.
  294. .. _class_TileMap_method_map_to_world:
  295. - :ref:`Vector2<class_Vector2>` **map_to_world** **(** :ref:`Vector2<class_Vector2>` map_position, :ref:`bool<class_bool>` ignore_half_ofs=false **)** const
  296. Returns the global position corresponding to the given tilemap (grid-based) coordinates.
  297. Optionally, the tilemap's half offset can be ignored.
  298. .. _class_TileMap_method_set_cell:
  299. - 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 ) **)**
  300. Sets the tile index for the cell given by a Vector2.
  301. An index of ``-1`` clears the cell.
  302. Optionally, the tile can also be flipped, transposed, or given autotile coordinates.
  303. Note that data such as navigation polygons and collision shapes are not immediately updated for performance reasons.
  304. If you need these to be immediately updated, you can call :ref:`update_dirty_quadrants<class_TileMap_method_update_dirty_quadrants>`.
  305. .. _class_TileMap_method_set_cellv:
  306. - 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 **)**
  307. Sets the tile index for the given cell.
  308. An index of ``-1`` clears the cell.
  309. Optionally, the tile can also be flipped or transposed.
  310. Note that data such as navigation polygons and collision shapes are not immediately updated for performance reasons.
  311. If you need these to be immediately updated, you can call :ref:`update_dirty_quadrants<class_TileMap_method_update_dirty_quadrants>`.
  312. .. _class_TileMap_method_set_collision_layer_bit:
  313. - void **set_collision_layer_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  314. Sets the given collision layer bit.
  315. .. _class_TileMap_method_set_collision_mask_bit:
  316. - void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  317. Sets the given collision mask bit.
  318. .. _class_TileMap_method_update_bitmask_area:
  319. - void **update_bitmask_area** **(** :ref:`Vector2<class_Vector2>` position **)**
  320. Applies autotiling rules to the cell (and its adjacent cells) referenced by its grid-based x and y coordinates.
  321. .. _class_TileMap_method_update_bitmask_region:
  322. - void **update_bitmask_region** **(** :ref:`Vector2<class_Vector2>` start=Vector2( 0, 0 ), :ref:`Vector2<class_Vector2>` end=Vector2( 0, 0 ) **)**
  323. Applies autotiling rules to the cells in the given region (specified by grid-based x and y coordinates).
  324. Calling with invalid (or missing) parameters applies autotiling rules for the entire tilemap.
  325. .. _class_TileMap_method_update_dirty_quadrants:
  326. - void **update_dirty_quadrants** **(** **)**
  327. Updates the tile map's quadrants, allowing things such as navigation and collision shapes to be immediately used if modified.
  328. .. _class_TileMap_method_world_to_map:
  329. - :ref:`Vector2<class_Vector2>` **world_to_map** **(** :ref:`Vector2<class_Vector2>` world_position **)** const
  330. Returns the tilemap (grid-based) coordinatescorresponding to the given global position.