class_tilemap.rst 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_TileMap:
  4. TileMap
  5. =======
  6. **Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Node for 2D tile-based games.
  11. Member Functions
  12. ----------------
  13. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`set_tileset<class_TileMap_set_tileset>` **(** :ref:`TileSet<class_tileset>` tileset **)** |
  15. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`TileSet<class_tileset>` | :ref:`get_tileset<class_TileMap_get_tileset>` **(** **)** const |
  17. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`set_mode<class_TileMap_set_mode>` **(** :ref:`int<class_int>` mode **)** |
  19. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`int<class_int>` | :ref:`get_mode<class_TileMap_get_mode>` **(** **)** const |
  21. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`set_half_offset<class_TileMap_set_half_offset>` **(** :ref:`int<class_int>` half_offset **)** |
  23. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`get_half_offset<class_TileMap_get_half_offset>` **(** **)** const |
  25. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`set_custom_transform<class_TileMap_set_custom_transform>` **(** :ref:`Matrix32<class_matrix32>` custom_transform **)** |
  27. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Matrix32<class_matrix32>` | :ref:`get_custom_transform<class_TileMap_get_custom_transform>` **(** **)** const |
  29. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`set_cell_size<class_TileMap_set_cell_size>` **(** :ref:`Vector2<class_vector2>` size **)** |
  31. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`Vector2<class_vector2>` | :ref:`get_cell_size<class_TileMap_get_cell_size>` **(** **)** const |
  33. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_quadrant_size<class_TileMap_set_quadrant_size>` **(** :ref:`int<class_int>` size **)** |
  35. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`get_quadrant_size<class_TileMap_get_quadrant_size>` **(** **)** const |
  37. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_tile_origin<class_TileMap_set_tile_origin>` **(** :ref:`int<class_int>` origin **)** |
  39. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`get_tile_origin<class_TileMap_get_tile_origin>` **(** **)** const |
  41. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`set_center_x<class_TileMap_set_center_x>` **(** :ref:`bool<class_bool>` enable **)** |
  43. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`get_center_x<class_TileMap_get_center_x>` **(** **)** const |
  45. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`set_center_y<class_TileMap_set_center_y>` **(** :ref:`bool<class_bool>` enable **)** |
  47. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`bool<class_bool>` | :ref:`get_center_y<class_TileMap_get_center_y>` **(** **)** const |
  49. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | void | :ref:`set_y_sort_mode<class_TileMap_set_y_sort_mode>` **(** :ref:`bool<class_bool>` enable **)** |
  51. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`is_y_sort_mode_enabled<class_TileMap_is_y_sort_mode_enabled>` **(** **)** const |
  53. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`set_collision_use_kinematic<class_TileMap_set_collision_use_kinematic>` **(** :ref:`bool<class_bool>` use_kinematic **)** |
  55. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`bool<class_bool>` | :ref:`get_collision_use_kinematic<class_TileMap_get_collision_use_kinematic>` **(** **)** const |
  57. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`set_collision_layer<class_TileMap_set_collision_layer>` **(** :ref:`int<class_int>` mask **)** |
  59. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`int<class_int>` | :ref:`get_collision_layer<class_TileMap_get_collision_layer>` **(** **)** const |
  61. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`set_collision_mask<class_TileMap_set_collision_mask>` **(** :ref:`int<class_int>` mask **)** |
  63. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`get_collision_mask<class_TileMap_get_collision_mask>` **(** **)** const |
  65. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | void | :ref:`set_collision_friction<class_TileMap_set_collision_friction>` **(** :ref:`float<class_float>` value **)** |
  67. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`float<class_float>` | :ref:`get_collision_friction<class_TileMap_get_collision_friction>` **(** **)** const |
  69. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`set_collision_bounce<class_TileMap_set_collision_bounce>` **(** :ref:`float<class_float>` value **)** |
  71. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`float<class_float>` | :ref:`get_collision_bounce<class_TileMap_get_collision_bounce>` **(** **)** const |
  73. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`set_occluder_light_mask<class_TileMap_set_occluder_light_mask>` **(** :ref:`int<class_int>` mask **)** |
  75. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`int<class_int>` | :ref:`get_occluder_light_mask<class_TileMap_get_occluder_light_mask>` **(** **)** const |
  77. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | 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 **)** |
  79. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`set_cellv<class_TileMap_set_cellv>` **(** :ref:`Vector2<class_vector2>` pos, :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 **)** |
  81. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`int<class_int>` | :ref:`get_cell<class_TileMap_get_cell>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const |
  83. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`int<class_int>` | :ref:`get_cellv<class_TileMap_get_cellv>` **(** :ref:`Vector2<class_vector2>` pos **)** const |
  85. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :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 |
  87. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :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 |
  89. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`bool<class_bool>` | :ref:`is_cell_transposed<class_TileMap_is_cell_transposed>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const |
  91. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`clear<class_TileMap_clear>` **(** **)** |
  93. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`Array<class_array>` | :ref:`get_used_cells<class_TileMap_get_used_cells>` **(** **)** const |
  95. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`Vector2<class_vector2>` | :ref:`map_to_world<class_TileMap_map_to_world>` **(** :ref:`Vector2<class_vector2>` mappos, :ref:`bool<class_bool>` ignore_half_ofs=false **)** const |
  97. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`Vector2<class_vector2>` | :ref:`world_to_map<class_TileMap_world_to_map>` **(** :ref:`Vector2<class_vector2>` worldpos **)** const |
  99. +----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. Signals
  101. -------
  102. - **settings_changed** **(** **)**
  103. Numeric Constants
  104. -----------------
  105. - **INVALID_CELL** = **-1** --- Returned when a cell doesn't exist.
  106. - **MODE_SQUARE** = **0** --- Orthogonal orientation mode.
  107. - **MODE_ISOMETRIC** = **1** --- Isometric orientation mode.
  108. - **MODE_CUSTOM** = **2** --- Custom orientation mode.
  109. - **HALF_OFFSET_X** = **0** --- Half offset on the X coordinate.
  110. - **HALF_OFFSET_Y** = **1** --- Half offset on the Y coordinate.
  111. - **HALF_OFFSET_DISABLED** = **2** --- Half offset disabled.
  112. - **TILE_ORIGIN_TOP_LEFT** = **0** --- Tile origin at its top-left corner.
  113. - **TILE_ORIGIN_CENTER** = **1** --- Tile origin at its center.
  114. Description
  115. -----------
  116. Node for 2D tile-based games. Tilemaps use a :ref:`TileSet<class_tileset>` which contain a list of tiles (textures, their rect and a collision) and are used to create complex grid-based maps.
  117. To optimize drawing and culling (sort of like :ref:`GridMap<class_gridmap>`), you can specify a quadrant size, so chunks of the map will be batched together at drawing time.
  118. Member Function Description
  119. ---------------------------
  120. .. _class_TileMap_set_tileset:
  121. - void **set_tileset** **(** :ref:`TileSet<class_tileset>` tileset **)**
  122. Set the current tileset.
  123. .. _class_TileMap_get_tileset:
  124. - :ref:`TileSet<class_tileset>` **get_tileset** **(** **)** const
  125. Return the current tileset.
  126. .. _class_TileMap_set_mode:
  127. - void **set_mode** **(** :ref:`int<class_int>` mode **)**
  128. Set the orientation mode as square, isometric or custom (use MODE\_\* constants as argument).
  129. .. _class_TileMap_get_mode:
  130. - :ref:`int<class_int>` **get_mode** **(** **)** const
  131. Return the orientation mode.
  132. .. _class_TileMap_set_half_offset:
  133. - void **set_half_offset** **(** :ref:`int<class_int>` half_offset **)**
  134. Set an half offset on the X coordinate, Y coordinate, or none (use HALF_OFFSET\_\* constants as argument).
  135. Half offset sets every other tile off by a half tile size in the specified direction.
  136. .. _class_TileMap_get_half_offset:
  137. - :ref:`int<class_int>` **get_half_offset** **(** **)** const
  138. Return the current half offset configuration.
  139. .. _class_TileMap_set_custom_transform:
  140. - void **set_custom_transform** **(** :ref:`Matrix32<class_matrix32>` custom_transform **)**
  141. Set custom transform matrix, to use in combination with the custom orientation mode.
  142. .. _class_TileMap_get_custom_transform:
  143. - :ref:`Matrix32<class_matrix32>` **get_custom_transform** **(** **)** const
  144. Return the custom transform matrix.
  145. .. _class_TileMap_set_cell_size:
  146. - void **set_cell_size** **(** :ref:`Vector2<class_vector2>` size **)**
  147. Set the cell size.
  148. .. _class_TileMap_get_cell_size:
  149. - :ref:`Vector2<class_vector2>` **get_cell_size** **(** **)** const
  150. Return the cell size.
  151. .. _class_TileMap_set_quadrant_size:
  152. - void **set_quadrant_size** **(** :ref:`int<class_int>` size **)**
  153. Set the quadrant size, this optimizes drawing by batching chunks of map at draw/cull time.
  154. Allowed values are integers ranging from 1 to 128.
  155. .. _class_TileMap_get_quadrant_size:
  156. - :ref:`int<class_int>` **get_quadrant_size** **(** **)** const
  157. Return the quadrant size.
  158. .. _class_TileMap_set_tile_origin:
  159. - void **set_tile_origin** **(** :ref:`int<class_int>` origin **)**
  160. Set the tile origin to the tile center or its top-left corner (use TILE_ORIGIN\_\* constants as argument).
  161. .. _class_TileMap_get_tile_origin:
  162. - :ref:`int<class_int>` **get_tile_origin** **(** **)** const
  163. Return the tile origin configuration.
  164. .. _class_TileMap_set_center_x:
  165. - void **set_center_x** **(** :ref:`bool<class_bool>` enable **)**
  166. Set tiles to be centered in x coordinate. (by default this is false and they are drawn from upper left cell corner).
  167. .. _class_TileMap_get_center_x:
  168. - :ref:`bool<class_bool>` **get_center_x** **(** **)** const
  169. Return true if tiles are to be centered in x coordinate (by default this is false and they are drawn from upper left cell corner).
  170. .. _class_TileMap_set_center_y:
  171. - void **set_center_y** **(** :ref:`bool<class_bool>` enable **)**
  172. Set tiles to be centered in y coordinate. (by default this is false and they are drawn from upper left cell corner).
  173. .. _class_TileMap_get_center_y:
  174. - :ref:`bool<class_bool>` **get_center_y** **(** **)** const
  175. Return true if tiles are to be centered in y coordinate (by default this is false and they are drawn from upper left cell corner).
  176. .. _class_TileMap_set_y_sort_mode:
  177. - void **set_y_sort_mode** **(** :ref:`bool<class_bool>` enable **)**
  178. Set the Y sort mode. Enabled Y sort mode means that children of the tilemap will be drawn in the order defined by their Y coordinate.
  179. A tile with a higher Y coordinate will therefore be drawn later, potentially covering up the tile(s) above it if its sprite is higher than its cell size.
  180. .. _class_TileMap_is_y_sort_mode_enabled:
  181. - :ref:`bool<class_bool>` **is_y_sort_mode_enabled** **(** **)** const
  182. Return the Y sort mode.
  183. .. _class_TileMap_set_collision_use_kinematic:
  184. - void **set_collision_use_kinematic** **(** :ref:`bool<class_bool>` use_kinematic **)**
  185. Set the tilemap to handle collisions as a kinematic body (enabled) or a static body (disabled).
  186. .. _class_TileMap_get_collision_use_kinematic:
  187. - :ref:`bool<class_bool>` **get_collision_use_kinematic** **(** **)** const
  188. Return whether the tilemap handles collisions as a kinematic body.
  189. .. _class_TileMap_set_collision_layer:
  190. - void **set_collision_layer** **(** :ref:`int<class_int>` mask **)**
  191. Set the collision layer.
  192. Layers are referenced by binary indexes, so allowable values to describe the 20 available layers range from 0 to 2^20-1.
  193. .. _class_TileMap_get_collision_layer:
  194. - :ref:`int<class_int>` **get_collision_layer** **(** **)** const
  195. Return the collision layer.
  196. .. _class_TileMap_set_collision_mask:
  197. - void **set_collision_mask** **(** :ref:`int<class_int>` mask **)**
  198. Set the collision masks.
  199. Masks are referenced by binary indexes, so allowable values to describe the 20 available masks range from 0 to 2^20-1.
  200. .. _class_TileMap_get_collision_mask:
  201. - :ref:`int<class_int>` **get_collision_mask** **(** **)** const
  202. Return the collision mask.
  203. .. _class_TileMap_set_collision_friction:
  204. - void **set_collision_friction** **(** :ref:`float<class_float>` value **)**
  205. Set the collision friction parameter.
  206. Allowable values range from 0 to 1.
  207. .. _class_TileMap_get_collision_friction:
  208. - :ref:`float<class_float>` **get_collision_friction** **(** **)** const
  209. Return the collision friction parameter.
  210. .. _class_TileMap_set_collision_bounce:
  211. - void **set_collision_bounce** **(** :ref:`float<class_float>` value **)**
  212. Set the collision bounce parameter.
  213. Allowable values range from 0 to 1.
  214. .. _class_TileMap_get_collision_bounce:
  215. - :ref:`float<class_float>` **get_collision_bounce** **(** **)** const
  216. Return the collision bounce parameter.
  217. .. _class_TileMap_set_occluder_light_mask:
  218. - void **set_occluder_light_mask** **(** :ref:`int<class_int>` mask **)**
  219. .. _class_TileMap_get_occluder_light_mask:
  220. - :ref:`int<class_int>` **get_occluder_light_mask** **(** **)** const
  221. .. _class_TileMap_set_cell:
  222. - 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 **)**
  223. Set the tile index for the cell referenced by its grid-based X and Y coordinates.
  224. A tile index of -1 clears the cell.
  225. Optionally, the tile can also be flipped over the X and Y coordinates or transposed.
  226. .. _class_TileMap_set_cellv:
  227. - void **set_cellv** **(** :ref:`Vector2<class_vector2>` pos, :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 **)**
  228. Set the tile index for the cell referenced by a Vector2 of grid-based coordinates.
  229. A tile index of -1 clears the cell.
  230. Optionally, the tile can also be flipped over the X and Y axes or transposed.
  231. .. _class_TileMap_get_cell:
  232. - :ref:`int<class_int>` **get_cell** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  233. Return the tile index of the referenced cell.
  234. .. _class_TileMap_get_cellv:
  235. - :ref:`int<class_int>` **get_cellv** **(** :ref:`Vector2<class_vector2>` pos **)** const
  236. Return the tile index of the cell referenced by a Vector2.
  237. .. _class_TileMap_is_cell_x_flipped:
  238. - :ref:`bool<class_bool>` **is_cell_x_flipped** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  239. Return whether the referenced cell is flipped over the X axis.
  240. .. _class_TileMap_is_cell_y_flipped:
  241. - :ref:`bool<class_bool>` **is_cell_y_flipped** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  242. Return whether the referenced cell is flipped over the Y axis.
  243. .. _class_TileMap_is_cell_transposed:
  244. - :ref:`bool<class_bool>` **is_cell_transposed** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  245. Return whether the referenced cell is transposed, i.e. the X and Y axes are swapped (mirroring with regard to the (1,1) vector).
  246. .. _class_TileMap_clear:
  247. - void **clear** **(** **)**
  248. Clear all cells.
  249. .. _class_TileMap_get_used_cells:
  250. - :ref:`Array<class_array>` **get_used_cells** **(** **)** const
  251. Return an array of all cells containing a tile from the tileset (i.e. a tile index different from -1).
  252. .. _class_TileMap_map_to_world:
  253. - :ref:`Vector2<class_vector2>` **map_to_world** **(** :ref:`Vector2<class_vector2>` mappos, :ref:`bool<class_bool>` ignore_half_ofs=false **)** const
  254. Return the absolute world position corresponding to the tilemap (grid-based) coordinates given as an argument.
  255. Optionally, the tilemap's potential half offset can be ignored.
  256. .. _class_TileMap_world_to_map:
  257. - :ref:`Vector2<class_vector2>` **world_to_map** **(** :ref:`Vector2<class_vector2>` worldpos **)** const
  258. Return the tilemap (grid-based) coordinates corresponding to the absolute world position given as an argument.