class_tileset.rst 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the TileSet.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_TileSet:
  5. TileSet
  6. =======
  7. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Tile library for tilemaps.
  12. Methods
  13. -------
  14. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`Vector2<class_Vector2>` | :ref:`_forward_subtile_selection<class_TileSet_method__forward_subtile_selection>` **(** :ref:`int<class_int>` autotile_id, :ref:`int<class_int>` bitmask, :ref:`Object<class_Object>` tilemap, :ref:`Vector2<class_Vector2>` tile_location **)** virtual |
  16. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`_is_tile_bound<class_TileSet_method__is_tile_bound>` **(** :ref:`int<class_int>` drawn_id, :ref:`int<class_int>` neighbor_id **)** virtual |
  18. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`autotile_clear_bitmask_map<class_TileSet_method_autotile_clear_bitmask_map>` **(** :ref:`int<class_int>` id **)** |
  20. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`autotile_get_bitmask<class_TileSet_method_autotile_get_bitmask>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** |
  22. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` | :ref:`autotile_get_bitmask_mode<class_TileSet_method_autotile_get_bitmask_mode>` **(** :ref:`int<class_int>` id **)** const |
  24. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Vector2<class_Vector2>` | :ref:`autotile_get_icon_coordinate<class_TileSet_method_autotile_get_icon_coordinate>` **(** :ref:`int<class_int>` id **)** const |
  26. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` | :ref:`autotile_get_light_occluder<class_TileSet_method_autotile_get_light_occluder>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** const |
  28. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`NavigationPolygon<class_NavigationPolygon>` | :ref:`autotile_get_navigation_polygon<class_TileSet_method_autotile_get_navigation_polygon>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** const |
  30. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`Vector2<class_Vector2>` | :ref:`autotile_get_size<class_TileSet_method_autotile_get_size>` **(** :ref:`int<class_int>` id **)** const |
  32. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`int<class_int>` | :ref:`autotile_get_spacing<class_TileSet_method_autotile_get_spacing>` **(** :ref:`int<class_int>` id **)** const |
  34. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`int<class_int>` | :ref:`autotile_get_subtile_priority<class_TileSet_method_autotile_get_subtile_priority>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** |
  36. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`int<class_int>` | :ref:`autotile_get_z_index<class_TileSet_method_autotile_get_z_index>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** |
  38. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`autotile_set_bitmask<class_TileSet_method_autotile_set_bitmask>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` bitmask, :ref:`int<class_int>` flag **)** |
  40. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`autotile_set_bitmask_mode<class_TileSet_method_autotile_set_bitmask_mode>` **(** :ref:`int<class_int>` id, :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` mode **)** |
  42. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`autotile_set_icon_coordinate<class_TileSet_method_autotile_set_icon_coordinate>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** |
  44. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`autotile_set_light_occluder<class_TileSet_method_autotile_set_light_occluder>` **(** :ref:`int<class_int>` id, :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` light_occluder, :ref:`Vector2<class_Vector2>` coord **)** |
  46. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`autotile_set_navigation_polygon<class_TileSet_method_autotile_set_navigation_polygon>` **(** :ref:`int<class_int>` id, :ref:`NavigationPolygon<class_NavigationPolygon>` navigation_polygon, :ref:`Vector2<class_Vector2>` coord **)** |
  48. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`autotile_set_size<class_TileSet_method_autotile_set_size>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` size **)** |
  50. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`autotile_set_spacing<class_TileSet_method_autotile_set_spacing>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` spacing **)** |
  52. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`autotile_set_subtile_priority<class_TileSet_method_autotile_set_subtile_priority>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord, :ref:`int<class_int>` priority **)** |
  54. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`autotile_set_z_index<class_TileSet_method_autotile_set_z_index>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord, :ref:`int<class_int>` z_index **)** |
  56. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`clear<class_TileSet_method_clear>` **(** **)** |
  58. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`create_tile<class_TileSet_method_create_tile>` **(** :ref:`int<class_int>` id **)** |
  60. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`find_tile_by_name<class_TileSet_method_find_tile_by_name>` **(** :ref:`String<class_String>` name **)** const |
  62. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`int<class_int>` | :ref:`get_last_unused_tile_id<class_TileSet_method_get_last_unused_tile_id>` **(** **)** const |
  64. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`Array<class_Array>` | :ref:`get_tiles_ids<class_TileSet_method_get_tiles_ids>` **(** **)** const |
  66. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`remove_tile<class_TileSet_method_remove_tile>` **(** :ref:`int<class_int>` id **)** |
  68. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`tile_add_shape<class_TileSet_method_tile_add_shape>` **(** :ref:`int<class_int>` id, :ref:`Shape2D<class_Shape2D>` shape, :ref:`Transform2D<class_Transform2D>` shape_transform, :ref:`bool<class_bool>` one_way=false, :ref:`Vector2<class_Vector2>` autotile_coord=Vector2( 0, 0 ) **)** |
  70. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` | :ref:`tile_get_light_occluder<class_TileSet_method_tile_get_light_occluder>` **(** :ref:`int<class_int>` id **)** const |
  72. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`ShaderMaterial<class_ShaderMaterial>` | :ref:`tile_get_material<class_TileSet_method_tile_get_material>` **(** :ref:`int<class_int>` id **)** const |
  74. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`Color<class_Color>` | :ref:`tile_get_modulate<class_TileSet_method_tile_get_modulate>` **(** :ref:`int<class_int>` id **)** const |
  76. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`String<class_String>` | :ref:`tile_get_name<class_TileSet_method_tile_get_name>` **(** :ref:`int<class_int>` id **)** const |
  78. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`NavigationPolygon<class_NavigationPolygon>` | :ref:`tile_get_navigation_polygon<class_TileSet_method_tile_get_navigation_polygon>` **(** :ref:`int<class_int>` id **)** const |
  80. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`Vector2<class_Vector2>` | :ref:`tile_get_navigation_polygon_offset<class_TileSet_method_tile_get_navigation_polygon_offset>` **(** :ref:`int<class_int>` id **)** const |
  82. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`Texture<class_Texture>` | :ref:`tile_get_normal_map<class_TileSet_method_tile_get_normal_map>` **(** :ref:`int<class_int>` id **)** const |
  84. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`Vector2<class_Vector2>` | :ref:`tile_get_occluder_offset<class_TileSet_method_tile_get_occluder_offset>` **(** :ref:`int<class_int>` id **)** const |
  86. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`Rect2<class_Rect2>` | :ref:`tile_get_region<class_TileSet_method_tile_get_region>` **(** :ref:`int<class_int>` id **)** const |
  88. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`Shape2D<class_Shape2D>` | :ref:`tile_get_shape<class_TileSet_method_tile_get_shape>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** const |
  90. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`int<class_int>` | :ref:`tile_get_shape_count<class_TileSet_method_tile_get_shape_count>` **(** :ref:`int<class_int>` id **)** const |
  92. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`Vector2<class_Vector2>` | :ref:`tile_get_shape_offset<class_TileSet_method_tile_get_shape_offset>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** const |
  94. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`bool<class_bool>` | :ref:`tile_get_shape_one_way<class_TileSet_method_tile_get_shape_one_way>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** const |
  96. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`float<class_float>` | :ref:`tile_get_shape_one_way_margin<class_TileSet_method_tile_get_shape_one_way_margin>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** const |
  98. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`Transform2D<class_Transform2D>` | :ref:`tile_get_shape_transform<class_TileSet_method_tile_get_shape_transform>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** const |
  100. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`Array<class_Array>` | :ref:`tile_get_shapes<class_TileSet_method_tile_get_shapes>` **(** :ref:`int<class_int>` id **)** const |
  102. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`Texture<class_Texture>` | :ref:`tile_get_texture<class_TileSet_method_tile_get_texture>` **(** :ref:`int<class_int>` id **)** const |
  104. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`Vector2<class_Vector2>` | :ref:`tile_get_texture_offset<class_TileSet_method_tile_get_texture_offset>` **(** :ref:`int<class_int>` id **)** const |
  106. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`TileMode<enum_TileSet_TileMode>` | :ref:`tile_get_tile_mode<class_TileSet_method_tile_get_tile_mode>` **(** :ref:`int<class_int>` id **)** const |
  108. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`int<class_int>` | :ref:`tile_get_z_index<class_TileSet_method_tile_get_z_index>` **(** :ref:`int<class_int>` id **)** const |
  110. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | void | :ref:`tile_set_light_occluder<class_TileSet_method_tile_set_light_occluder>` **(** :ref:`int<class_int>` id, :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` light_occluder **)** |
  112. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`tile_set_material<class_TileSet_method_tile_set_material>` **(** :ref:`int<class_int>` id, :ref:`ShaderMaterial<class_ShaderMaterial>` material **)** |
  114. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`tile_set_modulate<class_TileSet_method_tile_set_modulate>` **(** :ref:`int<class_int>` id, :ref:`Color<class_Color>` color **)** |
  116. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`tile_set_name<class_TileSet_method_tile_set_name>` **(** :ref:`int<class_int>` id, :ref:`String<class_String>` name **)** |
  118. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`tile_set_navigation_polygon<class_TileSet_method_tile_set_navigation_polygon>` **(** :ref:`int<class_int>` id, :ref:`NavigationPolygon<class_NavigationPolygon>` navigation_polygon **)** |
  120. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`tile_set_navigation_polygon_offset<class_TileSet_method_tile_set_navigation_polygon_offset>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` navigation_polygon_offset **)** |
  122. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | void | :ref:`tile_set_normal_map<class_TileSet_method_tile_set_normal_map>` **(** :ref:`int<class_int>` id, :ref:`Texture<class_Texture>` normal_map **)** |
  124. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`tile_set_occluder_offset<class_TileSet_method_tile_set_occluder_offset>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` occluder_offset **)** |
  126. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | void | :ref:`tile_set_region<class_TileSet_method_tile_set_region>` **(** :ref:`int<class_int>` id, :ref:`Rect2<class_Rect2>` region **)** |
  128. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | void | :ref:`tile_set_shape<class_TileSet_method_tile_set_shape>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`Shape2D<class_Shape2D>` shape **)** |
  130. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`tile_set_shape_offset<class_TileSet_method_tile_set_shape_offset>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`Vector2<class_Vector2>` shape_offset **)** |
  132. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`tile_set_shape_one_way<class_TileSet_method_tile_set_shape_one_way>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`bool<class_bool>` one_way **)** |
  134. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | void | :ref:`tile_set_shape_one_way_margin<class_TileSet_method_tile_set_shape_one_way_margin>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`float<class_float>` one_way **)** |
  136. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`tile_set_shape_transform<class_TileSet_method_tile_set_shape_transform>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`Transform2D<class_Transform2D>` shape_transform **)** |
  138. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`tile_set_shapes<class_TileSet_method_tile_set_shapes>` **(** :ref:`int<class_int>` id, :ref:`Array<class_Array>` shapes **)** |
  140. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`tile_set_texture<class_TileSet_method_tile_set_texture>` **(** :ref:`int<class_int>` id, :ref:`Texture<class_Texture>` texture **)** |
  142. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | void | :ref:`tile_set_texture_offset<class_TileSet_method_tile_set_texture_offset>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` texture_offset **)** |
  144. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | void | :ref:`tile_set_tile_mode<class_TileSet_method_tile_set_tile_mode>` **(** :ref:`int<class_int>` id, :ref:`TileMode<enum_TileSet_TileMode>` tilemode **)** |
  146. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | void | :ref:`tile_set_z_index<class_TileSet_method_tile_set_z_index>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` z_index **)** |
  148. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. Enumerations
  150. ------------
  151. .. _enum_TileSet_BitmaskMode:
  152. .. _class_TileSet_constant_BITMASK_2X2:
  153. .. _class_TileSet_constant_BITMASK_3X3_MINIMAL:
  154. .. _class_TileSet_constant_BITMASK_3X3:
  155. enum **BitmaskMode**:
  156. - **BITMASK_2X2** = **0**
  157. - **BITMASK_3X3_MINIMAL** = **1**
  158. - **BITMASK_3X3** = **2**
  159. .. _enum_TileSet_AutotileBindings:
  160. .. _class_TileSet_constant_BIND_TOPLEFT:
  161. .. _class_TileSet_constant_BIND_TOP:
  162. .. _class_TileSet_constant_BIND_TOPRIGHT:
  163. .. _class_TileSet_constant_BIND_LEFT:
  164. .. _class_TileSet_constant_BIND_RIGHT:
  165. .. _class_TileSet_constant_BIND_BOTTOMLEFT:
  166. .. _class_TileSet_constant_BIND_BOTTOM:
  167. .. _class_TileSet_constant_BIND_BOTTOMRIGHT:
  168. enum **AutotileBindings**:
  169. - **BIND_TOPLEFT** = **1**
  170. - **BIND_TOP** = **2**
  171. - **BIND_TOPRIGHT** = **4**
  172. - **BIND_LEFT** = **8**
  173. - **BIND_RIGHT** = **32**
  174. - **BIND_BOTTOMLEFT** = **64**
  175. - **BIND_BOTTOM** = **128**
  176. - **BIND_BOTTOMRIGHT** = **256**
  177. .. _enum_TileSet_TileMode:
  178. .. _class_TileSet_constant_SINGLE_TILE:
  179. .. _class_TileSet_constant_AUTO_TILE:
  180. .. _class_TileSet_constant_ATLAS_TILE:
  181. enum **TileMode**:
  182. - **SINGLE_TILE** = **0**
  183. - **AUTO_TILE** = **1**
  184. - **ATLAS_TILE** = **2**
  185. Description
  186. -----------
  187. A TileSet is a library of tiles for a :ref:`TileMap<class_TileMap>`. It contains a list of tiles, each consisting of a sprite and optional collision shapes.
  188. Tiles are referenced by a unique integer ID.
  189. Method Descriptions
  190. -------------------
  191. .. _class_TileSet_method__forward_subtile_selection:
  192. - :ref:`Vector2<class_Vector2>` **_forward_subtile_selection** **(** :ref:`int<class_int>` autotile_id, :ref:`int<class_int>` bitmask, :ref:`Object<class_Object>` tilemap, :ref:`Vector2<class_Vector2>` tile_location **)** virtual
  193. .. _class_TileSet_method__is_tile_bound:
  194. - :ref:`bool<class_bool>` **_is_tile_bound** **(** :ref:`int<class_int>` drawn_id, :ref:`int<class_int>` neighbor_id **)** virtual
  195. .. _class_TileSet_method_autotile_clear_bitmask_map:
  196. - void **autotile_clear_bitmask_map** **(** :ref:`int<class_int>` id **)**
  197. Clears all bitmask info of the autotile.
  198. .. _class_TileSet_method_autotile_get_bitmask:
  199. - :ref:`int<class_int>` **autotile_get_bitmask** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)**
  200. Returns the bitmask of the subtile from an autotile given its coordinates.
  201. The value is the sum of the values in :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).
  202. .. _class_TileSet_method_autotile_get_bitmask_mode:
  203. - :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` **autotile_get_bitmask_mode** **(** :ref:`int<class_int>` id **)** const
  204. Returns the :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` of the autotile.
  205. .. _class_TileSet_method_autotile_get_icon_coordinate:
  206. - :ref:`Vector2<class_Vector2>` **autotile_get_icon_coordinate** **(** :ref:`int<class_int>` id **)** const
  207. Returns the subtile that's being used as an icon in an atlas/autotile given its coordinates.
  208. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask info is incomplete. It will also be used to represent it in the TileSet editor.
  209. .. _class_TileSet_method_autotile_get_light_occluder:
  210. - :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` **autotile_get_light_occluder** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** const
  211. Returns the light occluder of the subtile from an atlas/autotile given its coordinates.
  212. .. _class_TileSet_method_autotile_get_navigation_polygon:
  213. - :ref:`NavigationPolygon<class_NavigationPolygon>` **autotile_get_navigation_polygon** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** const
  214. Returns the navigation polygon of the subtile from an atlas/autotile given its coordinates.
  215. .. _class_TileSet_method_autotile_get_size:
  216. - :ref:`Vector2<class_Vector2>` **autotile_get_size** **(** :ref:`int<class_int>` id **)** const
  217. Returns the size of the subtiles in an atlas/autotile.
  218. .. _class_TileSet_method_autotile_get_spacing:
  219. - :ref:`int<class_int>` **autotile_get_spacing** **(** :ref:`int<class_int>` id **)** const
  220. Returns the spacing between subtiles of the atlas/autotile.
  221. .. _class_TileSet_method_autotile_get_subtile_priority:
  222. - :ref:`int<class_int>` **autotile_get_subtile_priority** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)**
  223. Returns the priority of the subtile from an autotile given its coordinates.
  224. When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked.
  225. .. _class_TileSet_method_autotile_get_z_index:
  226. - :ref:`int<class_int>` **autotile_get_z_index** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)**
  227. Returns the drawing index of the subtile from an atlas/autotile given its coordinates.
  228. .. _class_TileSet_method_autotile_set_bitmask:
  229. - void **autotile_set_bitmask** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` bitmask, :ref:`int<class_int>` flag **)**
  230. Sets the bitmask of the subtile from an autotile given its coordinates.
  231. The value is the sum of the values in :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).
  232. .. _class_TileSet_method_autotile_set_bitmask_mode:
  233. - void **autotile_set_bitmask_mode** **(** :ref:`int<class_int>` id, :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` mode **)**
  234. Sets the :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` of the autotile.
  235. .. _class_TileSet_method_autotile_set_icon_coordinate:
  236. - void **autotile_set_icon_coordinate** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)**
  237. Sets the subtile that will be used as an icon in an atlas/autotile given its coordinates.
  238. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask info is incomplete. It will also be used to represent it in the TileSet editor.
  239. .. _class_TileSet_method_autotile_set_light_occluder:
  240. - void **autotile_set_light_occluder** **(** :ref:`int<class_int>` id, :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` light_occluder, :ref:`Vector2<class_Vector2>` coord **)**
  241. Sets the light occluder of the subtile from an atlas/autotile given its coordinates.
  242. .. _class_TileSet_method_autotile_set_navigation_polygon:
  243. - void **autotile_set_navigation_polygon** **(** :ref:`int<class_int>` id, :ref:`NavigationPolygon<class_NavigationPolygon>` navigation_polygon, :ref:`Vector2<class_Vector2>` coord **)**
  244. Sets the navigation polygon of the subtile from an atlas/autotile given its coordinates.
  245. .. _class_TileSet_method_autotile_set_size:
  246. - void **autotile_set_size** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` size **)**
  247. Sets the size of the subtiles in an atlas/autotile.
  248. .. _class_TileSet_method_autotile_set_spacing:
  249. - void **autotile_set_spacing** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` spacing **)**
  250. Sets the spacing between subtiles of the atlas/autotile.
  251. .. _class_TileSet_method_autotile_set_subtile_priority:
  252. - void **autotile_set_subtile_priority** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord, :ref:`int<class_int>` priority **)**
  253. Sets the priority of the subtile from an autotile given its coordinates.
  254. When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked.
  255. .. _class_TileSet_method_autotile_set_z_index:
  256. - void **autotile_set_z_index** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord, :ref:`int<class_int>` z_index **)**
  257. Sets the drawing index of the subtile from an atlas/autotile given its coordinates.
  258. .. _class_TileSet_method_clear:
  259. - void **clear** **(** **)**
  260. Clears all tiles.
  261. .. _class_TileSet_method_create_tile:
  262. - void **create_tile** **(** :ref:`int<class_int>` id **)**
  263. Creates a new tile with the given ID.
  264. .. _class_TileSet_method_find_tile_by_name:
  265. - :ref:`int<class_int>` **find_tile_by_name** **(** :ref:`String<class_String>` name **)** const
  266. Returns the first tile matching the given name.
  267. .. _class_TileSet_method_get_last_unused_tile_id:
  268. - :ref:`int<class_int>` **get_last_unused_tile_id** **(** **)** const
  269. Returns the ID following the last currently used ID, useful when creating a new tile.
  270. .. _class_TileSet_method_get_tiles_ids:
  271. - :ref:`Array<class_Array>` **get_tiles_ids** **(** **)** const
  272. Returns an array of all currently used tile IDs.
  273. .. _class_TileSet_method_remove_tile:
  274. - void **remove_tile** **(** :ref:`int<class_int>` id **)**
  275. Removes the given tile ID.
  276. .. _class_TileSet_method_tile_add_shape:
  277. - void **tile_add_shape** **(** :ref:`int<class_int>` id, :ref:`Shape2D<class_Shape2D>` shape, :ref:`Transform2D<class_Transform2D>` shape_transform, :ref:`bool<class_bool>` one_way=false, :ref:`Vector2<class_Vector2>` autotile_coord=Vector2( 0, 0 ) **)**
  278. Adds a shape to the tile.
  279. .. _class_TileSet_method_tile_get_light_occluder:
  280. - :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` **tile_get_light_occluder** **(** :ref:`int<class_int>` id **)** const
  281. Returns the tile's light occluder.
  282. .. _class_TileSet_method_tile_get_material:
  283. - :ref:`ShaderMaterial<class_ShaderMaterial>` **tile_get_material** **(** :ref:`int<class_int>` id **)** const
  284. Returns the tile's material.
  285. .. _class_TileSet_method_tile_get_modulate:
  286. - :ref:`Color<class_Color>` **tile_get_modulate** **(** :ref:`int<class_int>` id **)** const
  287. Returns the tile's modulation color.
  288. .. _class_TileSet_method_tile_get_name:
  289. - :ref:`String<class_String>` **tile_get_name** **(** :ref:`int<class_int>` id **)** const
  290. Returns the tile's name.
  291. .. _class_TileSet_method_tile_get_navigation_polygon:
  292. - :ref:`NavigationPolygon<class_NavigationPolygon>` **tile_get_navigation_polygon** **(** :ref:`int<class_int>` id **)** const
  293. Returns the navigation polygon of the tile.
  294. .. _class_TileSet_method_tile_get_navigation_polygon_offset:
  295. - :ref:`Vector2<class_Vector2>` **tile_get_navigation_polygon_offset** **(** :ref:`int<class_int>` id **)** const
  296. Returns the offset of the tile's navigation polygon.
  297. .. _class_TileSet_method_tile_get_normal_map:
  298. - :ref:`Texture<class_Texture>` **tile_get_normal_map** **(** :ref:`int<class_int>` id **)** const
  299. Returns the tile's normal map texture.
  300. .. _class_TileSet_method_tile_get_occluder_offset:
  301. - :ref:`Vector2<class_Vector2>` **tile_get_occluder_offset** **(** :ref:`int<class_int>` id **)** const
  302. Returns the offset of the tile's light occluder.
  303. .. _class_TileSet_method_tile_get_region:
  304. - :ref:`Rect2<class_Rect2>` **tile_get_region** **(** :ref:`int<class_int>` id **)** const
  305. Returns the tile sub-region in the texture.
  306. .. _class_TileSet_method_tile_get_shape:
  307. - :ref:`Shape2D<class_Shape2D>` **tile_get_shape** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** const
  308. Returns a tile's given shape.
  309. .. _class_TileSet_method_tile_get_shape_count:
  310. - :ref:`int<class_int>` **tile_get_shape_count** **(** :ref:`int<class_int>` id **)** const
  311. Returns the number of shapes assigned to a tile.
  312. .. _class_TileSet_method_tile_get_shape_offset:
  313. - :ref:`Vector2<class_Vector2>` **tile_get_shape_offset** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** const
  314. Returns the offset of a tile's shape.
  315. .. _class_TileSet_method_tile_get_shape_one_way:
  316. - :ref:`bool<class_bool>` **tile_get_shape_one_way** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** const
  317. Returns the one-way collision value of a tile's shape.
  318. .. _class_TileSet_method_tile_get_shape_one_way_margin:
  319. - :ref:`float<class_float>` **tile_get_shape_one_way_margin** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** const
  320. .. _class_TileSet_method_tile_get_shape_transform:
  321. - :ref:`Transform2D<class_Transform2D>` **tile_get_shape_transform** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** const
  322. Returns the :ref:`Transform2D<class_Transform2D>` of a tile's shape.
  323. .. _class_TileSet_method_tile_get_shapes:
  324. - :ref:`Array<class_Array>` **tile_get_shapes** **(** :ref:`int<class_int>` id **)** const
  325. Returns an array of the tile's shapes.
  326. .. _class_TileSet_method_tile_get_texture:
  327. - :ref:`Texture<class_Texture>` **tile_get_texture** **(** :ref:`int<class_int>` id **)** const
  328. Returns the tile's texture.
  329. .. _class_TileSet_method_tile_get_texture_offset:
  330. - :ref:`Vector2<class_Vector2>` **tile_get_texture_offset** **(** :ref:`int<class_int>` id **)** const
  331. Returns the texture offset of the tile.
  332. .. _class_TileSet_method_tile_get_tile_mode:
  333. - :ref:`TileMode<enum_TileSet_TileMode>` **tile_get_tile_mode** **(** :ref:`int<class_int>` id **)** const
  334. Returns the tile's :ref:`TileMode<enum_TileSet_TileMode>`.
  335. .. _class_TileSet_method_tile_get_z_index:
  336. - :ref:`int<class_int>` **tile_get_z_index** **(** :ref:`int<class_int>` id **)** const
  337. Returns the tile's z-index (drawing layer).
  338. .. _class_TileSet_method_tile_set_light_occluder:
  339. - void **tile_set_light_occluder** **(** :ref:`int<class_int>` id, :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` light_occluder **)**
  340. Sets a light occluder for the tile.
  341. .. _class_TileSet_method_tile_set_material:
  342. - void **tile_set_material** **(** :ref:`int<class_int>` id, :ref:`ShaderMaterial<class_ShaderMaterial>` material **)**
  343. Sets the tile's material.
  344. .. _class_TileSet_method_tile_set_modulate:
  345. - void **tile_set_modulate** **(** :ref:`int<class_int>` id, :ref:`Color<class_Color>` color **)**
  346. Sets the tile's modulation color.
  347. .. _class_TileSet_method_tile_set_name:
  348. - void **tile_set_name** **(** :ref:`int<class_int>` id, :ref:`String<class_String>` name **)**
  349. Sets the tile's name.
  350. .. _class_TileSet_method_tile_set_navigation_polygon:
  351. - void **tile_set_navigation_polygon** **(** :ref:`int<class_int>` id, :ref:`NavigationPolygon<class_NavigationPolygon>` navigation_polygon **)**
  352. Sets the tile's navigation polygon.
  353. .. _class_TileSet_method_tile_set_navigation_polygon_offset:
  354. - void **tile_set_navigation_polygon_offset** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` navigation_polygon_offset **)**
  355. Sets an offset for the tile's navigation polygon.
  356. .. _class_TileSet_method_tile_set_normal_map:
  357. - void **tile_set_normal_map** **(** :ref:`int<class_int>` id, :ref:`Texture<class_Texture>` normal_map **)**
  358. Sets the tile's normal map texture.
  359. .. _class_TileSet_method_tile_set_occluder_offset:
  360. - void **tile_set_occluder_offset** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` occluder_offset **)**
  361. Sets an offset for the tile's light occluder.
  362. .. _class_TileSet_method_tile_set_region:
  363. - void **tile_set_region** **(** :ref:`int<class_int>` id, :ref:`Rect2<class_Rect2>` region **)**
  364. Sets the tile's sub-region in the texture. This is common in texture atlases.
  365. .. _class_TileSet_method_tile_set_shape:
  366. - void **tile_set_shape** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`Shape2D<class_Shape2D>` shape **)**
  367. Sets a shape for the tile, enabling collision.
  368. .. _class_TileSet_method_tile_set_shape_offset:
  369. - void **tile_set_shape_offset** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`Vector2<class_Vector2>` shape_offset **)**
  370. Sets the offset of a tile's shape.
  371. .. _class_TileSet_method_tile_set_shape_one_way:
  372. - void **tile_set_shape_one_way** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`bool<class_bool>` one_way **)**
  373. Enables one-way collision on a tile's shape.
  374. .. _class_TileSet_method_tile_set_shape_one_way_margin:
  375. - void **tile_set_shape_one_way_margin** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`float<class_float>` one_way **)**
  376. .. _class_TileSet_method_tile_set_shape_transform:
  377. - void **tile_set_shape_transform** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`Transform2D<class_Transform2D>` shape_transform **)**
  378. Sets a :ref:`Transform2D<class_Transform2D>` on a tile's shape.
  379. .. _class_TileSet_method_tile_set_shapes:
  380. - void **tile_set_shapes** **(** :ref:`int<class_int>` id, :ref:`Array<class_Array>` shapes **)**
  381. Sets an array of shapes for the tile, enabling collision.
  382. .. _class_TileSet_method_tile_set_texture:
  383. - void **tile_set_texture** **(** :ref:`int<class_int>` id, :ref:`Texture<class_Texture>` texture **)**
  384. Sets the tile's texture.
  385. .. _class_TileSet_method_tile_set_texture_offset:
  386. - void **tile_set_texture_offset** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` texture_offset **)**
  387. Sets the tile's texture offset.
  388. .. _class_TileSet_method_tile_set_tile_mode:
  389. - void **tile_set_tile_mode** **(** :ref:`int<class_int>` id, :ref:`TileMode<enum_TileSet_TileMode>` tilemode **)**
  390. Sets the tile's :ref:`TileMode<enum_TileSet_TileMode>`.
  391. .. _class_TileSet_method_tile_set_z_index:
  392. - void **tile_set_z_index** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` z_index **)**
  393. Sets the tile's drawing index.