class_tilemap.rst 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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. Member Functions
  13. ----------------
  14. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`clear<class_TileMap_clear>` **(** **)** |
  16. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`get_cell<class_TileMap_get_cell>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const |
  18. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Vector2<class_vector2>` | :ref:`get_cell_size<class_TileMap_get_cell_size>` **(** **)** const |
  20. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`get_cellv<class_TileMap_get_cellv>` **(** :ref:`Vector2<class_vector2>` position **)** const |
  22. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`get_center_x<class_TileMap_get_center_x>` **(** **)** const |
  24. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`get_center_y<class_TileMap_get_center_y>` **(** **)** const |
  26. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`get_collision_bounce<class_TileMap_get_collision_bounce>` **(** **)** const |
  28. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`float<class_float>` | :ref:`get_collision_friction<class_TileMap_get_collision_friction>` **(** **)** const |
  30. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`int<class_int>` | :ref:`get_collision_layer<class_TileMap_get_collision_layer>` **(** **)** const |
  32. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`get_collision_layer_bit<class_TileMap_get_collision_layer_bit>` **(** :ref:`int<class_int>` bit **)** const |
  34. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`int<class_int>` | :ref:`get_collision_mask<class_TileMap_get_collision_mask>` **(** **)** const |
  36. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_bit<class_TileMap_get_collision_mask_bit>` **(** :ref:`int<class_int>` bit **)** const |
  38. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`get_collision_use_kinematic<class_TileMap_get_collision_use_kinematic>` **(** **)** const |
  40. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Transform2D<class_transform2d>` | :ref:`get_custom_transform<class_TileMap_get_custom_transform>` **(** **)** const |
  42. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`int<class_int>` | :ref:`get_half_offset<class_TileMap_get_half_offset>` **(** **)** const |
  44. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`int<class_int>` | :ref:`get_mode<class_TileMap_get_mode>` **(** **)** const |
  46. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`int<class_int>` | :ref:`get_occluder_light_mask<class_TileMap_get_occluder_light_mask>` **(** **)** const |
  48. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`int<class_int>` | :ref:`get_quadrant_size<class_TileMap_get_quadrant_size>` **(** **)** const |
  50. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`int<class_int>` | :ref:`get_tile_origin<class_TileMap_get_tile_origin>` **(** **)** const |
  52. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`TileSet<class_tileset>` | :ref:`get_tileset<class_TileMap_get_tileset>` **(** **)** const |
  54. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`Array<class_array>` | :ref:`get_used_cells<class_TileMap_get_used_cells>` **(** **)** const |
  56. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`Array<class_array>` | :ref:`get_used_cells_by_id<class_TileMap_get_used_cells_by_id>` **(** :ref:`int<class_int>` id **)** const |
  58. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Rect2<class_rect2>` | :ref:`get_used_rect<class_TileMap_get_used_rect>` **(** **)** |
  60. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`is_cell_transposed<class_TileMap_is_cell_transposed>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const |
  62. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :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 |
  64. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :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 |
  66. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`bool<class_bool>` | :ref:`is_y_sort_mode_enabled<class_TileMap_is_y_sort_mode_enabled>` **(** **)** const |
  68. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :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 |
  70. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | 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 **)** |
  72. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`set_cell_size<class_TileMap_set_cell_size>` **(** :ref:`Vector2<class_vector2>` size **)** |
  74. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | 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 **)** |
  76. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`set_center_x<class_TileMap_set_center_x>` **(** :ref:`bool<class_bool>` enable **)** |
  78. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`set_center_y<class_TileMap_set_center_y>` **(** :ref:`bool<class_bool>` enable **)** |
  80. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`set_collision_bounce<class_TileMap_set_collision_bounce>` **(** :ref:`float<class_float>` value **)** |
  82. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`set_collision_friction<class_TileMap_set_collision_friction>` **(** :ref:`float<class_float>` value **)** |
  84. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`set_collision_layer<class_TileMap_set_collision_layer>` **(** :ref:`int<class_int>` layer **)** |
  86. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`set_collision_layer_bit<class_TileMap_set_collision_layer_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  88. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`set_collision_mask<class_TileMap_set_collision_mask>` **(** :ref:`int<class_int>` mask **)** |
  90. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`set_collision_mask_bit<class_TileMap_set_collision_mask_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  92. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`set_collision_use_kinematic<class_TileMap_set_collision_use_kinematic>` **(** :ref:`bool<class_bool>` use_kinematic **)** |
  94. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`set_custom_transform<class_TileMap_set_custom_transform>` **(** :ref:`Transform2D<class_transform2d>` custom_transform **)** |
  96. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`set_half_offset<class_TileMap_set_half_offset>` **(** :ref:`int<class_int>` half_offset **)** |
  98. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`set_mode<class_TileMap_set_mode>` **(** :ref:`int<class_int>` mode **)** |
  100. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`set_occluder_light_mask<class_TileMap_set_occluder_light_mask>` **(** :ref:`int<class_int>` mask **)** |
  102. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`set_quadrant_size<class_TileMap_set_quadrant_size>` **(** :ref:`int<class_int>` size **)** |
  104. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | void | :ref:`set_tile_origin<class_TileMap_set_tile_origin>` **(** :ref:`int<class_int>` origin **)** |
  106. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | void | :ref:`set_tileset<class_TileMap_set_tileset>` **(** :ref:`TileSet<class_tileset>` tileset **)** |
  108. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`set_y_sort_mode<class_TileMap_set_y_sort_mode>` **(** :ref:`bool<class_bool>` enable **)** |
  110. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`Vector2<class_vector2>` | :ref:`world_to_map<class_TileMap_world_to_map>` **(** :ref:`Vector2<class_vector2>` world_position **)** const |
  112. +----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. Signals
  114. -------
  115. - **settings_changed** **(** **)**
  116. Emitted when a tilemap setting has changed.
  117. Member Variables
  118. ----------------
  119. - :ref:`Transform2D<class_transform2d>` **cell_custom_transform** - The custom [Transform2D] to be applied to the TileMap's cells.
  120. - :ref:`int<class_int>` **cell_half_offset** - Amount to offset alternating tiles. Uses HALF_OFFSET_* constants. Default value: HALF_OFFSET_DISABLED.
  121. - :ref:`int<class_int>` **cell_quadrant_size** - The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. Default value: 16.
  122. - :ref:`Vector2<class_vector2>` **cell_size** - The TileMap's cell size.
  123. - :ref:`int<class_int>` **cell_tile_origin** - Position for tile origin. Uses TILE_ORIGIN_* constants. Default value: TILE_ORIGIN_TOP_LEFT.
  124. - :ref:`bool<class_bool>` **cell_y_sort** - If [code]true[/code] the TileMap's children will be drawn in order of their Y coordinate. Default value: [code]false[/code].
  125. - :ref:`float<class_float>` **collision_bounce** - Bounce value for static body collisions (see [code]collision_use_kinematic[/code]). Default value: 0.
  126. - :ref:`float<class_float>` **collision_friction** - Friction value for static body collisions (see [code]collision_use_kinematic[/code]). Default value: 1.
  127. - :ref:`int<class_int>` **collision_layer** - The collision layer(s) for all colliders in the TileMap.
  128. - :ref:`int<class_int>` **collision_mask** - The collision mask(s) for all colliders in the TileMap.
  129. - :ref:`bool<class_bool>` **collision_use_kinematic** - If [code]true[/code] TileMap collisions will be handled as a kinematic body. If [code]false[/code] collisions will be handled as static body. Default value: [code]false[/code].
  130. - :ref:`int<class_int>` **mode** - The TileMap orientation mode. Uses MODE_* constants. Default value: MODE_SQUARE.
  131. - :ref:`int<class_int>` **occluder_light_mask** - 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).
  132. - :ref:`PoolIntArray<class_poolintarray>` **tile_data** - A [PoolIntArray] containing
  133. - :ref:`TileSet<class_tileset>` **tile_set** - The assigned [TileSet].
  134. Numeric Constants
  135. -----------------
  136. - **INVALID_CELL** = **-1** --- Returned when a cell doesn't exist.
  137. - **MODE_SQUARE** = **0** --- Orthogonal orientation mode.
  138. - **MODE_ISOMETRIC** = **1** --- Isometric orientation mode.
  139. - **MODE_CUSTOM** = **2** --- Custom orientation mode.
  140. - **HALF_OFFSET_X** = **0** --- Half offset on the X coordinate.
  141. - **HALF_OFFSET_Y** = **1** --- Half offset on the Y coordinate.
  142. - **HALF_OFFSET_DISABLED** = **2** --- Half offset disabled.
  143. - **TILE_ORIGIN_TOP_LEFT** = **0** --- Tile origin at its top-left corner.
  144. - **TILE_ORIGIN_CENTER** = **1** --- Tile origin at its center.
  145. - **TILE_ORIGIN_BOTTOM_LEFT** = **2**
  146. Description
  147. -----------
  148. 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.
  149. Member Function Description
  150. ---------------------------
  151. .. _class_TileMap_clear:
  152. - void **clear** **(** **)**
  153. Clear all cells.
  154. .. _class_TileMap_get_cell:
  155. - :ref:`int<class_int>` **get_cell** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  156. Return the tile index of the referenced cell.
  157. .. _class_TileMap_get_cell_size:
  158. - :ref:`Vector2<class_vector2>` **get_cell_size** **(** **)** const
  159. Return the cell size.
  160. .. _class_TileMap_get_cellv:
  161. - :ref:`int<class_int>` **get_cellv** **(** :ref:`Vector2<class_vector2>` position **)** const
  162. Return the tile index of the cell referenced by a Vector2.
  163. .. _class_TileMap_get_center_x:
  164. - :ref:`bool<class_bool>` **get_center_x** **(** **)** const
  165. 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).
  166. .. _class_TileMap_get_center_y:
  167. - :ref:`bool<class_bool>` **get_center_y** **(** **)** const
  168. 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).
  169. .. _class_TileMap_get_collision_bounce:
  170. - :ref:`float<class_float>` **get_collision_bounce** **(** **)** const
  171. Return the collision bounce parameter.
  172. .. _class_TileMap_get_collision_friction:
  173. - :ref:`float<class_float>` **get_collision_friction** **(** **)** const
  174. Return the collision friction parameter.
  175. .. _class_TileMap_get_collision_layer:
  176. - :ref:`int<class_int>` **get_collision_layer** **(** **)** const
  177. Return the collision layer.
  178. .. _class_TileMap_get_collision_layer_bit:
  179. - :ref:`bool<class_bool>` **get_collision_layer_bit** **(** :ref:`int<class_int>` bit **)** const
  180. .. _class_TileMap_get_collision_mask:
  181. - :ref:`int<class_int>` **get_collision_mask** **(** **)** const
  182. Return the collision mask.
  183. .. _class_TileMap_get_collision_mask_bit:
  184. - :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** const
  185. .. _class_TileMap_get_collision_use_kinematic:
  186. - :ref:`bool<class_bool>` **get_collision_use_kinematic** **(** **)** const
  187. Return whether the tilemap handles collisions as a kinematic body.
  188. .. _class_TileMap_get_custom_transform:
  189. - :ref:`Transform2D<class_transform2d>` **get_custom_transform** **(** **)** const
  190. Return the custom transform matrix.
  191. .. _class_TileMap_get_half_offset:
  192. - :ref:`int<class_int>` **get_half_offset** **(** **)** const
  193. Return the current half offset configuration.
  194. .. _class_TileMap_get_mode:
  195. - :ref:`int<class_int>` **get_mode** **(** **)** const
  196. Return the orientation mode.
  197. .. _class_TileMap_get_occluder_light_mask:
  198. - :ref:`int<class_int>` **get_occluder_light_mask** **(** **)** const
  199. .. _class_TileMap_get_quadrant_size:
  200. - :ref:`int<class_int>` **get_quadrant_size** **(** **)** const
  201. Return the quadrant size.
  202. .. _class_TileMap_get_tile_origin:
  203. - :ref:`int<class_int>` **get_tile_origin** **(** **)** const
  204. Return the tile origin configuration.
  205. .. _class_TileMap_get_tileset:
  206. - :ref:`TileSet<class_tileset>` **get_tileset** **(** **)** const
  207. Return the current tileset.
  208. .. _class_TileMap_get_used_cells:
  209. - :ref:`Array<class_array>` **get_used_cells** **(** **)** const
  210. Return an array of all cells containing a tile from the tileset (i.e. a tile index different from -1).
  211. .. _class_TileMap_get_used_cells_by_id:
  212. - :ref:`Array<class_array>` **get_used_cells_by_id** **(** :ref:`int<class_int>` id **)** const
  213. .. _class_TileMap_get_used_rect:
  214. - :ref:`Rect2<class_rect2>` **get_used_rect** **(** **)**
  215. .. _class_TileMap_is_cell_transposed:
  216. - :ref:`bool<class_bool>` **is_cell_transposed** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  217. Return whether the referenced cell is transposed, i.e. the X and Y axes are swapped (mirroring with regard to the (1,1) vector).
  218. .. _class_TileMap_is_cell_x_flipped:
  219. - :ref:`bool<class_bool>` **is_cell_x_flipped** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  220. Return whether the referenced cell is flipped over the X axis.
  221. .. _class_TileMap_is_cell_y_flipped:
  222. - :ref:`bool<class_bool>` **is_cell_y_flipped** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** const
  223. Return whether the referenced cell is flipped over the Y axis.
  224. .. _class_TileMap_is_y_sort_mode_enabled:
  225. - :ref:`bool<class_bool>` **is_y_sort_mode_enabled** **(** **)** const
  226. Return the Y sort mode.
  227. .. _class_TileMap_map_to_world:
  228. - :ref:`Vector2<class_vector2>` **map_to_world** **(** :ref:`Vector2<class_vector2>` map_position, :ref:`bool<class_bool>` ignore_half_ofs=false **)** const
  229. Return the absolute world position corresponding to the tilemap (grid-based) coordinates given as an argument.
  230. Optionally, the tilemap's potential half offset can be ignored.
  231. .. _class_TileMap_set_cell:
  232. - 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 **)**
  233. Set the tile index for the cell referenced by its grid-based X and Y coordinates.
  234. A tile index of -1 clears the cell.
  235. Optionally, the tile can also be flipped over the X and Y coordinates or transposed.
  236. .. _class_TileMap_set_cell_size:
  237. - void **set_cell_size** **(** :ref:`Vector2<class_vector2>` size **)**
  238. Set the cell size.
  239. .. _class_TileMap_set_cellv:
  240. - 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 **)**
  241. Set the tile index for the cell referenced by a Vector2 of grid-based coordinates.
  242. A tile index of -1 clears the cell.
  243. Optionally, the tile can also be flipped over the X and Y axes or transposed.
  244. .. _class_TileMap_set_center_x:
  245. - void **set_center_x** **(** :ref:`bool<class_bool>` enable **)**
  246. Set tiles to be centered in x coordinate. (by default this is false and they are drawn from upper left cell corner).
  247. .. _class_TileMap_set_center_y:
  248. - void **set_center_y** **(** :ref:`bool<class_bool>` enable **)**
  249. Set tiles to be centered in y coordinate. (by default this is false and they are drawn from upper left cell corner).
  250. .. _class_TileMap_set_collision_bounce:
  251. - void **set_collision_bounce** **(** :ref:`float<class_float>` value **)**
  252. Set the collision bounce parameter. Allowable values range from 0 to 1.
  253. .. _class_TileMap_set_collision_friction:
  254. - void **set_collision_friction** **(** :ref:`float<class_float>` value **)**
  255. Set the collision friction parameter. Allowable values range from 0 to 1.
  256. .. _class_TileMap_set_collision_layer:
  257. - void **set_collision_layer** **(** :ref:`int<class_int>` layer **)**
  258. Set the collision layer.
  259. Layers are referenced by binary indexes, so allowable values to describe the 20 available layers range from 0 to 2^20-1.
  260. .. _class_TileMap_set_collision_layer_bit:
  261. - void **set_collision_layer_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  262. .. _class_TileMap_set_collision_mask:
  263. - void **set_collision_mask** **(** :ref:`int<class_int>` mask **)**
  264. Set the collision masks.
  265. Masks are referenced by binary indexes, so allowable values to describe the 20 available masks range from 0 to 2^20-1.
  266. .. _class_TileMap_set_collision_mask_bit:
  267. - void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  268. .. _class_TileMap_set_collision_use_kinematic:
  269. - void **set_collision_use_kinematic** **(** :ref:`bool<class_bool>` use_kinematic **)**
  270. Set the tilemap to handle collisions as a kinematic body (enabled) or a static body (disabled).
  271. .. _class_TileMap_set_custom_transform:
  272. - void **set_custom_transform** **(** :ref:`Transform2D<class_transform2d>` custom_transform **)**
  273. Set custom transform matrix, to use in combination with the custom orientation mode.
  274. .. _class_TileMap_set_half_offset:
  275. - void **set_half_offset** **(** :ref:`int<class_int>` half_offset **)**
  276. Set a half offset on the X coordinate, Y coordinate, or none (use HALF_OFFSET\_\* constants as argument).
  277. Half offset sets every other tile off by a half tile size in the specified direction.
  278. .. _class_TileMap_set_mode:
  279. - void **set_mode** **(** :ref:`int<class_int>` mode **)**
  280. Set the orientation mode as square, isometric or custom (use MODE\_\* constants as argument).
  281. .. _class_TileMap_set_occluder_light_mask:
  282. - void **set_occluder_light_mask** **(** :ref:`int<class_int>` mask **)**
  283. .. _class_TileMap_set_quadrant_size:
  284. - void **set_quadrant_size** **(** :ref:`int<class_int>` size **)**
  285. Set the quadrant size, this optimizes drawing by batching chunks of map at draw/cull time.
  286. Allowed values are integers ranging from 1 to 128.
  287. .. _class_TileMap_set_tile_origin:
  288. - void **set_tile_origin** **(** :ref:`int<class_int>` origin **)**
  289. Set the tile origin to the tile center or its top-left corner (use TILE_ORIGIN\_\* constants as argument).
  290. .. _class_TileMap_set_tileset:
  291. - void **set_tileset** **(** :ref:`TileSet<class_tileset>` tileset **)**
  292. Set the current tileset.
  293. .. _class_TileMap_set_y_sort_mode:
  294. - void **set_y_sort_mode** **(** :ref:`bool<class_bool>` enable **)**
  295. 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.
  296. 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.
  297. .. _class_TileMap_world_to_map:
  298. - :ref:`Vector2<class_vector2>` **world_to_map** **(** :ref:`Vector2<class_vector2>` world_position **)** const
  299. Return the tilemap (grid-based) coordinates corresponding to the absolute world position given as an argument.