class_tileset.rst 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/TileSet.xml.
  6. .. _class_TileSet:
  7. TileSet
  8. =======
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Tile library for tilemaps.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. Tiles are referenced by a unique integer ID.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Using Tilemaps <../tutorials/2d/using_tilemaps>`
  20. - `2D Platformer Demo <https://godotengine.org/asset-library/asset/120>`__
  21. - `2D Isometric Demo <https://godotengine.org/asset-library/asset/112>`__
  22. - `2D Hexagonal Demo <https://godotengine.org/asset-library/asset/111>`__
  23. - `2D Navigation Astar Demo <https://godotengine.org/asset-library/asset/519>`__
  24. - `2D Role Playing Game Demo <https://godotengine.org/asset-library/asset/520>`__
  25. - `2D Kinematic Character Demo <https://godotengine.org/asset-library/asset/113>`__
  26. .. rst-class:: classref-reftable-group
  27. Methods
  28. -------
  29. .. table::
  30. :widths: auto
  31. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`Vector2<class_Vector2>` | :ref:`_forward_atlas_subtile_selection<class_TileSet_method__forward_atlas_subtile_selection>` **(** :ref:`int<class_int>` atlastile_id, :ref:`Object<class_Object>` tilemap, :ref:`Vector2<class_Vector2>` tile_location **)** |virtual| |
  33. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :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| |
  35. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :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| |
  37. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`autotile_clear_bitmask_map<class_TileSet_method_autotile_clear_bitmask_map>` **(** :ref:`int<class_int>` id **)** |
  39. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`autotile_get_bitmask<class_TileSet_method_autotile_get_bitmask>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** |
  41. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` | :ref:`autotile_get_bitmask_mode<class_TileSet_method_autotile_get_bitmask_mode>` **(** :ref:`int<class_int>` id **)** |const| |
  43. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`FallbackMode<enum_TileSet_FallbackMode>` | :ref:`autotile_get_fallback_mode<class_TileSet_method_autotile_get_fallback_mode>` **(** :ref:`int<class_int>` id **)** |const| |
  45. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Vector2<class_Vector2>` | :ref:`autotile_get_icon_coordinate<class_TileSet_method_autotile_get_icon_coordinate>` **(** :ref:`int<class_int>` id **)** |const| |
  47. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :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| |
  49. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :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| |
  51. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`Vector2<class_Vector2>` | :ref:`autotile_get_size<class_TileSet_method_autotile_get_size>` **(** :ref:`int<class_int>` id **)** |const| |
  53. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`int<class_int>` | :ref:`autotile_get_spacing<class_TileSet_method_autotile_get_spacing>` **(** :ref:`int<class_int>` id **)** |const| |
  55. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :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 **)** |
  57. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :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 **)** |
  59. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | 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 **)** |
  61. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`autotile_set_bitmask_mode<class_TileSet_method_autotile_set_bitmask_mode>` **(** :ref:`int<class_int>` id, :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` mode **)** |
  63. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | void | :ref:`autotile_set_fallback_mode<class_TileSet_method_autotile_set_fallback_mode>` **(** :ref:`int<class_int>` id, :ref:`FallbackMode<enum_TileSet_FallbackMode>` mode **)** |
  65. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | void | :ref:`autotile_set_icon_coordinate<class_TileSet_method_autotile_set_icon_coordinate>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** |
  67. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | 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 **)** |
  69. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | 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 **)** |
  71. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`autotile_set_size<class_TileSet_method_autotile_set_size>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` size **)** |
  73. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`autotile_set_spacing<class_TileSet_method_autotile_set_spacing>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` spacing **)** |
  75. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | 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 **)** |
  77. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | 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 **)** |
  79. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`clear<class_TileSet_method_clear>` **(** **)** |
  81. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`create_tile<class_TileSet_method_create_tile>` **(** :ref:`int<class_int>` id **)** |
  83. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`int<class_int>` | :ref:`find_tile_by_name<class_TileSet_method_find_tile_by_name>` **(** :ref:`String<class_String>` name **)** |const| |
  85. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`int<class_int>` | :ref:`get_last_unused_tile_id<class_TileSet_method_get_last_unused_tile_id>` **(** **)** |const| |
  87. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`Array<class_Array>` | :ref:`get_tiles_ids<class_TileSet_method_get_tiles_ids>` **(** **)** |const| |
  89. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`remove_tile<class_TileSet_method_remove_tile>` **(** :ref:`int<class_int>` id **)** |
  91. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | 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 ) **)** |
  93. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` | :ref:`tile_get_light_occluder<class_TileSet_method_tile_get_light_occluder>` **(** :ref:`int<class_int>` id **)** |const| |
  95. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`ShaderMaterial<class_ShaderMaterial>` | :ref:`tile_get_material<class_TileSet_method_tile_get_material>` **(** :ref:`int<class_int>` id **)** |const| |
  97. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`Color<class_Color>` | :ref:`tile_get_modulate<class_TileSet_method_tile_get_modulate>` **(** :ref:`int<class_int>` id **)** |const| |
  99. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`String<class_String>` | :ref:`tile_get_name<class_TileSet_method_tile_get_name>` **(** :ref:`int<class_int>` id **)** |const| |
  101. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`NavigationPolygon<class_NavigationPolygon>` | :ref:`tile_get_navigation_polygon<class_TileSet_method_tile_get_navigation_polygon>` **(** :ref:`int<class_int>` id **)** |const| |
  103. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`Vector2<class_Vector2>` | :ref:`tile_get_navigation_polygon_offset<class_TileSet_method_tile_get_navigation_polygon_offset>` **(** :ref:`int<class_int>` id **)** |const| |
  105. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`Texture<class_Texture>` | :ref:`tile_get_normal_map<class_TileSet_method_tile_get_normal_map>` **(** :ref:`int<class_int>` id **)** |const| |
  107. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`Vector2<class_Vector2>` | :ref:`tile_get_occluder_offset<class_TileSet_method_tile_get_occluder_offset>` **(** :ref:`int<class_int>` id **)** |const| |
  109. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`Rect2<class_Rect2>` | :ref:`tile_get_region<class_TileSet_method_tile_get_region>` **(** :ref:`int<class_int>` id **)** |const| |
  111. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :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| |
  113. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`int<class_int>` | :ref:`tile_get_shape_count<class_TileSet_method_tile_get_shape_count>` **(** :ref:`int<class_int>` id **)** |const| |
  115. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :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| |
  117. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :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| |
  119. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :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| |
  121. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :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| |
  123. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`Array<class_Array>` | :ref:`tile_get_shapes<class_TileSet_method_tile_get_shapes>` **(** :ref:`int<class_int>` id **)** |const| |
  125. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`Texture<class_Texture>` | :ref:`tile_get_texture<class_TileSet_method_tile_get_texture>` **(** :ref:`int<class_int>` id **)** |const| |
  127. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`Vector2<class_Vector2>` | :ref:`tile_get_texture_offset<class_TileSet_method_tile_get_texture_offset>` **(** :ref:`int<class_int>` id **)** |const| |
  129. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`TileMode<enum_TileSet_TileMode>` | :ref:`tile_get_tile_mode<class_TileSet_method_tile_get_tile_mode>` **(** :ref:`int<class_int>` id **)** |const| |
  131. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`int<class_int>` | :ref:`tile_get_z_index<class_TileSet_method_tile_get_z_index>` **(** :ref:`int<class_int>` id **)** |const| |
  133. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`tile_set_light_occluder<class_TileSet_method_tile_set_light_occluder>` **(** :ref:`int<class_int>` id, :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` light_occluder **)** |
  135. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | void | :ref:`tile_set_material<class_TileSet_method_tile_set_material>` **(** :ref:`int<class_int>` id, :ref:`ShaderMaterial<class_ShaderMaterial>` material **)** |
  137. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`tile_set_modulate<class_TileSet_method_tile_set_modulate>` **(** :ref:`int<class_int>` id, :ref:`Color<class_Color>` color **)** |
  139. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`tile_set_name<class_TileSet_method_tile_set_name>` **(** :ref:`int<class_int>` id, :ref:`String<class_String>` name **)** |
  141. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`tile_set_navigation_polygon<class_TileSet_method_tile_set_navigation_polygon>` **(** :ref:`int<class_int>` id, :ref:`NavigationPolygon<class_NavigationPolygon>` navigation_polygon **)** |
  143. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | 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 **)** |
  145. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | void | :ref:`tile_set_normal_map<class_TileSet_method_tile_set_normal_map>` **(** :ref:`int<class_int>` id, :ref:`Texture<class_Texture>` normal_map **)** |
  147. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | void | :ref:`tile_set_occluder_offset<class_TileSet_method_tile_set_occluder_offset>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` occluder_offset **)** |
  149. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | void | :ref:`tile_set_region<class_TileSet_method_tile_set_region>` **(** :ref:`int<class_int>` id, :ref:`Rect2<class_Rect2>` region **)** |
  151. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | 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 **)** |
  153. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | 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 **)** |
  155. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | 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 **)** |
  157. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | 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 **)** |
  159. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | 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 **)** |
  161. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | void | :ref:`tile_set_shapes<class_TileSet_method_tile_set_shapes>` **(** :ref:`int<class_int>` id, :ref:`Array<class_Array>` shapes **)** |
  163. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | void | :ref:`tile_set_texture<class_TileSet_method_tile_set_texture>` **(** :ref:`int<class_int>` id, :ref:`Texture<class_Texture>` texture **)** |
  165. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | void | :ref:`tile_set_texture_offset<class_TileSet_method_tile_set_texture_offset>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` texture_offset **)** |
  167. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | void | :ref:`tile_set_tile_mode<class_TileSet_method_tile_set_tile_mode>` **(** :ref:`int<class_int>` id, :ref:`TileMode<enum_TileSet_TileMode>` tilemode **)** |
  169. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | void | :ref:`tile_set_z_index<class_TileSet_method_tile_set_z_index>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` z_index **)** |
  171. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. .. rst-class:: classref-section-separator
  173. ----
  174. .. rst-class:: classref-descriptions-group
  175. Enumerations
  176. ------------
  177. .. _enum_TileSet_BitmaskMode:
  178. .. rst-class:: classref-enumeration
  179. enum **BitmaskMode**:
  180. .. _class_TileSet_constant_BITMASK_2X2:
  181. .. rst-class:: classref-enumeration-constant
  182. :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` **BITMASK_2X2** = ``0``
  183. .. _class_TileSet_constant_BITMASK_3X3_MINIMAL:
  184. .. rst-class:: classref-enumeration-constant
  185. :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` **BITMASK_3X3_MINIMAL** = ``1``
  186. .. _class_TileSet_constant_BITMASK_3X3:
  187. .. rst-class:: classref-enumeration-constant
  188. :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` **BITMASK_3X3** = ``2``
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _enum_TileSet_FallbackMode:
  192. .. rst-class:: classref-enumeration
  193. enum **FallbackMode**:
  194. .. _class_TileSet_constant_FALLBACK_AUTO:
  195. .. rst-class:: classref-enumeration-constant
  196. :ref:`FallbackMode<enum_TileSet_FallbackMode>` **FALLBACK_AUTO** = ``0``
  197. Autotiles will automatically find a best match for missing tiles if they're incomplete.
  198. .. _class_TileSet_constant_FALLBACK_ICON:
  199. .. rst-class:: classref-enumeration-constant
  200. :ref:`FallbackMode<enum_TileSet_FallbackMode>` **FALLBACK_ICON** = ``1``
  201. Autotiles will use the icon tile for missing tiles if they're incomplete.
  202. .. rst-class:: classref-item-separator
  203. ----
  204. .. _enum_TileSet_AutotileBindings:
  205. .. rst-class:: classref-enumeration
  206. enum **AutotileBindings**:
  207. .. _class_TileSet_constant_BIND_TOPLEFT:
  208. .. rst-class:: classref-enumeration-constant
  209. :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` **BIND_TOPLEFT** = ``1``
  210. .. _class_TileSet_constant_BIND_TOP:
  211. .. rst-class:: classref-enumeration-constant
  212. :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` **BIND_TOP** = ``2``
  213. .. _class_TileSet_constant_BIND_TOPRIGHT:
  214. .. rst-class:: classref-enumeration-constant
  215. :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` **BIND_TOPRIGHT** = ``4``
  216. .. _class_TileSet_constant_BIND_LEFT:
  217. .. rst-class:: classref-enumeration-constant
  218. :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` **BIND_LEFT** = ``8``
  219. .. _class_TileSet_constant_BIND_CENTER:
  220. .. rst-class:: classref-enumeration-constant
  221. :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` **BIND_CENTER** = ``16``
  222. .. _class_TileSet_constant_BIND_RIGHT:
  223. .. rst-class:: classref-enumeration-constant
  224. :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` **BIND_RIGHT** = ``32``
  225. .. _class_TileSet_constant_BIND_BOTTOMLEFT:
  226. .. rst-class:: classref-enumeration-constant
  227. :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` **BIND_BOTTOMLEFT** = ``64``
  228. .. _class_TileSet_constant_BIND_BOTTOM:
  229. .. rst-class:: classref-enumeration-constant
  230. :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` **BIND_BOTTOM** = ``128``
  231. .. _class_TileSet_constant_BIND_BOTTOMRIGHT:
  232. .. rst-class:: classref-enumeration-constant
  233. :ref:`AutotileBindings<enum_TileSet_AutotileBindings>` **BIND_BOTTOMRIGHT** = ``256``
  234. .. rst-class:: classref-item-separator
  235. ----
  236. .. _enum_TileSet_TileMode:
  237. .. rst-class:: classref-enumeration
  238. enum **TileMode**:
  239. .. _class_TileSet_constant_SINGLE_TILE:
  240. .. rst-class:: classref-enumeration-constant
  241. :ref:`TileMode<enum_TileSet_TileMode>` **SINGLE_TILE** = ``0``
  242. .. _class_TileSet_constant_AUTO_TILE:
  243. .. rst-class:: classref-enumeration-constant
  244. :ref:`TileMode<enum_TileSet_TileMode>` **AUTO_TILE** = ``1``
  245. .. _class_TileSet_constant_ATLAS_TILE:
  246. .. rst-class:: classref-enumeration-constant
  247. :ref:`TileMode<enum_TileSet_TileMode>` **ATLAS_TILE** = ``2``
  248. .. rst-class:: classref-section-separator
  249. ----
  250. .. rst-class:: classref-descriptions-group
  251. Method Descriptions
  252. -------------------
  253. .. _class_TileSet_method__forward_atlas_subtile_selection:
  254. .. rst-class:: classref-method
  255. :ref:`Vector2<class_Vector2>` **_forward_atlas_subtile_selection** **(** :ref:`int<class_int>` atlastile_id, :ref:`Object<class_Object>` tilemap, :ref:`Vector2<class_Vector2>` tile_location **)** |virtual|
  256. .. container:: contribute
  257. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_TileSet_method__forward_subtile_selection:
  261. .. rst-class:: classref-method
  262. :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|
  263. .. container:: contribute
  264. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  265. .. rst-class:: classref-item-separator
  266. ----
  267. .. _class_TileSet_method__is_tile_bound:
  268. .. rst-class:: classref-method
  269. :ref:`bool<class_bool>` **_is_tile_bound** **(** :ref:`int<class_int>` drawn_id, :ref:`int<class_int>` neighbor_id **)** |virtual|
  270. Determines when the auto-tiler should consider two different auto-tile IDs to be bound together.
  271. \ **Note:** ``neighbor_id`` will be ``-1`` (:ref:`TileMap.INVALID_CELL<class_TileMap_constant_INVALID_CELL>`) when checking a tile against an empty neighbor tile.
  272. .. rst-class:: classref-item-separator
  273. ----
  274. .. _class_TileSet_method_autotile_clear_bitmask_map:
  275. .. rst-class:: classref-method
  276. void **autotile_clear_bitmask_map** **(** :ref:`int<class_int>` id **)**
  277. Clears all bitmask information of the autotile.
  278. .. rst-class:: classref-item-separator
  279. ----
  280. .. _class_TileSet_method_autotile_get_bitmask:
  281. .. rst-class:: classref-method
  282. :ref:`int<class_int>` **autotile_get_bitmask** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)**
  283. Returns the bitmask of the subtile from an autotile given its coordinates.
  284. 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).
  285. .. rst-class:: classref-item-separator
  286. ----
  287. .. _class_TileSet_method_autotile_get_bitmask_mode:
  288. .. rst-class:: classref-method
  289. :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` **autotile_get_bitmask_mode** **(** :ref:`int<class_int>` id **)** |const|
  290. Returns the :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` of the autotile.
  291. .. rst-class:: classref-item-separator
  292. ----
  293. .. _class_TileSet_method_autotile_get_fallback_mode:
  294. .. rst-class:: classref-method
  295. :ref:`FallbackMode<enum_TileSet_FallbackMode>` **autotile_get_fallback_mode** **(** :ref:`int<class_int>` id **)** |const|
  296. Returns the :ref:`FallbackMode<enum_TileSet_FallbackMode>` of the autotile.
  297. .. rst-class:: classref-item-separator
  298. ----
  299. .. _class_TileSet_method_autotile_get_icon_coordinate:
  300. .. rst-class:: classref-method
  301. :ref:`Vector2<class_Vector2>` **autotile_get_icon_coordinate** **(** :ref:`int<class_int>` id **)** |const|
  302. Returns the subtile that's being used as an icon in an atlas/autotile given its coordinates.
  303. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _class_TileSet_method_autotile_get_light_occluder:
  307. .. rst-class:: classref-method
  308. :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` **autotile_get_light_occluder** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** |const|
  309. Returns the light occluder of the subtile from an atlas/autotile given its coordinates.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_TileSet_method_autotile_get_navigation_polygon:
  313. .. rst-class:: classref-method
  314. :ref:`NavigationPolygon<class_NavigationPolygon>` **autotile_get_navigation_polygon** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)** |const|
  315. Returns the navigation polygon of the subtile from an atlas/autotile given its coordinates.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_TileSet_method_autotile_get_size:
  319. .. rst-class:: classref-method
  320. :ref:`Vector2<class_Vector2>` **autotile_get_size** **(** :ref:`int<class_int>` id **)** |const|
  321. Returns the size of the subtiles in an atlas/autotile.
  322. .. rst-class:: classref-item-separator
  323. ----
  324. .. _class_TileSet_method_autotile_get_spacing:
  325. .. rst-class:: classref-method
  326. :ref:`int<class_int>` **autotile_get_spacing** **(** :ref:`int<class_int>` id **)** |const|
  327. Returns the spacing between subtiles of the atlas/autotile.
  328. .. rst-class:: classref-item-separator
  329. ----
  330. .. _class_TileSet_method_autotile_get_subtile_priority:
  331. .. rst-class:: classref-method
  332. :ref:`int<class_int>` **autotile_get_subtile_priority** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)**
  333. Returns the priority of the subtile from an autotile given its coordinates.
  334. 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.
  335. .. rst-class:: classref-item-separator
  336. ----
  337. .. _class_TileSet_method_autotile_get_z_index:
  338. .. rst-class:: classref-method
  339. :ref:`int<class_int>` **autotile_get_z_index** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)**
  340. Returns the drawing index of the subtile from an atlas/autotile given its coordinates.
  341. .. rst-class:: classref-item-separator
  342. ----
  343. .. _class_TileSet_method_autotile_set_bitmask:
  344. .. rst-class:: classref-method
  345. void **autotile_set_bitmask** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` bitmask, :ref:`int<class_int>` flag **)**
  346. Sets the bitmask of the subtile from an autotile given its coordinates.
  347. 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).
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_TileSet_method_autotile_set_bitmask_mode:
  351. .. rst-class:: classref-method
  352. void **autotile_set_bitmask_mode** **(** :ref:`int<class_int>` id, :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` mode **)**
  353. Sets the :ref:`BitmaskMode<enum_TileSet_BitmaskMode>` of the autotile.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_TileSet_method_autotile_set_fallback_mode:
  357. .. rst-class:: classref-method
  358. void **autotile_set_fallback_mode** **(** :ref:`int<class_int>` id, :ref:`FallbackMode<enum_TileSet_FallbackMode>` mode **)**
  359. Returns the :ref:`FallbackMode<enum_TileSet_FallbackMode>` of the autotile.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_TileSet_method_autotile_set_icon_coordinate:
  363. .. rst-class:: classref-method
  364. void **autotile_set_icon_coordinate** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord **)**
  365. Sets the subtile that will be used as an icon in an atlas/autotile given its coordinates.
  366. The subtile defined as the icon may be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor.
  367. .. rst-class:: classref-item-separator
  368. ----
  369. .. _class_TileSet_method_autotile_set_light_occluder:
  370. .. rst-class:: classref-method
  371. void **autotile_set_light_occluder** **(** :ref:`int<class_int>` id, :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` light_occluder, :ref:`Vector2<class_Vector2>` coord **)**
  372. Sets the light occluder of the subtile from an atlas/autotile given its coordinates.
  373. .. rst-class:: classref-item-separator
  374. ----
  375. .. _class_TileSet_method_autotile_set_navigation_polygon:
  376. .. rst-class:: classref-method
  377. void **autotile_set_navigation_polygon** **(** :ref:`int<class_int>` id, :ref:`NavigationPolygon<class_NavigationPolygon>` navigation_polygon, :ref:`Vector2<class_Vector2>` coord **)**
  378. Sets the navigation polygon of the subtile from an atlas/autotile given its coordinates.
  379. .. rst-class:: classref-item-separator
  380. ----
  381. .. _class_TileSet_method_autotile_set_size:
  382. .. rst-class:: classref-method
  383. void **autotile_set_size** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` size **)**
  384. Sets the size of the subtiles in an atlas/autotile.
  385. .. rst-class:: classref-item-separator
  386. ----
  387. .. _class_TileSet_method_autotile_set_spacing:
  388. .. rst-class:: classref-method
  389. void **autotile_set_spacing** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` spacing **)**
  390. Sets the spacing between subtiles of the atlas/autotile.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _class_TileSet_method_autotile_set_subtile_priority:
  394. .. rst-class:: classref-method
  395. void **autotile_set_subtile_priority** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord, :ref:`int<class_int>` priority **)**
  396. Sets the priority of the subtile from an autotile given its coordinates.
  397. 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.
  398. .. rst-class:: classref-item-separator
  399. ----
  400. .. _class_TileSet_method_autotile_set_z_index:
  401. .. rst-class:: classref-method
  402. void **autotile_set_z_index** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` coord, :ref:`int<class_int>` z_index **)**
  403. Sets the drawing index of the subtile from an atlas/autotile given its coordinates.
  404. .. rst-class:: classref-item-separator
  405. ----
  406. .. _class_TileSet_method_clear:
  407. .. rst-class:: classref-method
  408. void **clear** **(** **)**
  409. Clears all tiles.
  410. .. rst-class:: classref-item-separator
  411. ----
  412. .. _class_TileSet_method_create_tile:
  413. .. rst-class:: classref-method
  414. void **create_tile** **(** :ref:`int<class_int>` id **)**
  415. Creates a new tile with the given ID.
  416. .. rst-class:: classref-item-separator
  417. ----
  418. .. _class_TileSet_method_find_tile_by_name:
  419. .. rst-class:: classref-method
  420. :ref:`int<class_int>` **find_tile_by_name** **(** :ref:`String<class_String>` name **)** |const|
  421. Returns the first tile matching the given name.
  422. .. rst-class:: classref-item-separator
  423. ----
  424. .. _class_TileSet_method_get_last_unused_tile_id:
  425. .. rst-class:: classref-method
  426. :ref:`int<class_int>` **get_last_unused_tile_id** **(** **)** |const|
  427. Returns the ID following the last currently used ID, useful when creating a new tile.
  428. .. rst-class:: classref-item-separator
  429. ----
  430. .. _class_TileSet_method_get_tiles_ids:
  431. .. rst-class:: classref-method
  432. :ref:`Array<class_Array>` **get_tiles_ids** **(** **)** |const|
  433. Returns an array of all currently used tile IDs.
  434. .. rst-class:: classref-item-separator
  435. ----
  436. .. _class_TileSet_method_remove_tile:
  437. .. rst-class:: classref-method
  438. void **remove_tile** **(** :ref:`int<class_int>` id **)**
  439. Removes the given tile ID.
  440. .. rst-class:: classref-item-separator
  441. ----
  442. .. _class_TileSet_method_tile_add_shape:
  443. .. rst-class:: classref-method
  444. 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 ) **)**
  445. Adds a shape to the tile.
  446. .. rst-class:: classref-item-separator
  447. ----
  448. .. _class_TileSet_method_tile_get_light_occluder:
  449. .. rst-class:: classref-method
  450. :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` **tile_get_light_occluder** **(** :ref:`int<class_int>` id **)** |const|
  451. Returns the tile's light occluder.
  452. .. rst-class:: classref-item-separator
  453. ----
  454. .. _class_TileSet_method_tile_get_material:
  455. .. rst-class:: classref-method
  456. :ref:`ShaderMaterial<class_ShaderMaterial>` **tile_get_material** **(** :ref:`int<class_int>` id **)** |const|
  457. Returns the tile's material.
  458. .. rst-class:: classref-item-separator
  459. ----
  460. .. _class_TileSet_method_tile_get_modulate:
  461. .. rst-class:: classref-method
  462. :ref:`Color<class_Color>` **tile_get_modulate** **(** :ref:`int<class_int>` id **)** |const|
  463. Returns the tile's modulation color.
  464. .. rst-class:: classref-item-separator
  465. ----
  466. .. _class_TileSet_method_tile_get_name:
  467. .. rst-class:: classref-method
  468. :ref:`String<class_String>` **tile_get_name** **(** :ref:`int<class_int>` id **)** |const|
  469. Returns the tile's name.
  470. .. rst-class:: classref-item-separator
  471. ----
  472. .. _class_TileSet_method_tile_get_navigation_polygon:
  473. .. rst-class:: classref-method
  474. :ref:`NavigationPolygon<class_NavigationPolygon>` **tile_get_navigation_polygon** **(** :ref:`int<class_int>` id **)** |const|
  475. Returns the navigation polygon of the tile.
  476. .. rst-class:: classref-item-separator
  477. ----
  478. .. _class_TileSet_method_tile_get_navigation_polygon_offset:
  479. .. rst-class:: classref-method
  480. :ref:`Vector2<class_Vector2>` **tile_get_navigation_polygon_offset** **(** :ref:`int<class_int>` id **)** |const|
  481. Returns the offset of the tile's navigation polygon.
  482. .. rst-class:: classref-item-separator
  483. ----
  484. .. _class_TileSet_method_tile_get_normal_map:
  485. .. rst-class:: classref-method
  486. :ref:`Texture<class_Texture>` **tile_get_normal_map** **(** :ref:`int<class_int>` id **)** |const|
  487. Returns the tile's normal map texture.
  488. .. rst-class:: classref-item-separator
  489. ----
  490. .. _class_TileSet_method_tile_get_occluder_offset:
  491. .. rst-class:: classref-method
  492. :ref:`Vector2<class_Vector2>` **tile_get_occluder_offset** **(** :ref:`int<class_int>` id **)** |const|
  493. Returns the offset of the tile's light occluder.
  494. .. rst-class:: classref-item-separator
  495. ----
  496. .. _class_TileSet_method_tile_get_region:
  497. .. rst-class:: classref-method
  498. :ref:`Rect2<class_Rect2>` **tile_get_region** **(** :ref:`int<class_int>` id **)** |const|
  499. Returns the tile sub-region in the texture.
  500. .. rst-class:: classref-item-separator
  501. ----
  502. .. _class_TileSet_method_tile_get_shape:
  503. .. rst-class:: classref-method
  504. :ref:`Shape2D<class_Shape2D>` **tile_get_shape** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** |const|
  505. Returns a tile's given shape.
  506. .. rst-class:: classref-item-separator
  507. ----
  508. .. _class_TileSet_method_tile_get_shape_count:
  509. .. rst-class:: classref-method
  510. :ref:`int<class_int>` **tile_get_shape_count** **(** :ref:`int<class_int>` id **)** |const|
  511. Returns the number of shapes assigned to a tile.
  512. .. rst-class:: classref-item-separator
  513. ----
  514. .. _class_TileSet_method_tile_get_shape_offset:
  515. .. rst-class:: classref-method
  516. :ref:`Vector2<class_Vector2>` **tile_get_shape_offset** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** |const|
  517. Returns the offset of a tile's shape.
  518. .. rst-class:: classref-item-separator
  519. ----
  520. .. _class_TileSet_method_tile_get_shape_one_way:
  521. .. rst-class:: classref-method
  522. :ref:`bool<class_bool>` **tile_get_shape_one_way** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** |const|
  523. Returns the one-way collision value of a tile's shape.
  524. .. rst-class:: classref-item-separator
  525. ----
  526. .. _class_TileSet_method_tile_get_shape_one_way_margin:
  527. .. rst-class:: classref-method
  528. :ref:`float<class_float>` **tile_get_shape_one_way_margin** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** |const|
  529. .. container:: contribute
  530. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  531. .. rst-class:: classref-item-separator
  532. ----
  533. .. _class_TileSet_method_tile_get_shape_transform:
  534. .. rst-class:: classref-method
  535. :ref:`Transform2D<class_Transform2D>` **tile_get_shape_transform** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id **)** |const|
  536. Returns the :ref:`Transform2D<class_Transform2D>` of a tile's shape.
  537. .. rst-class:: classref-item-separator
  538. ----
  539. .. _class_TileSet_method_tile_get_shapes:
  540. .. rst-class:: classref-method
  541. :ref:`Array<class_Array>` **tile_get_shapes** **(** :ref:`int<class_int>` id **)** |const|
  542. Returns an array of dictionaries describing the tile's shapes.
  543. \ **Dictionary structure in the array returned by this method:**\
  544. ::
  545. {
  546. "autotile_coord": Vector2,
  547. "one_way": bool,
  548. "one_way_margin": int,
  549. "shape": CollisionShape2D,
  550. "shape_transform": Transform2D,
  551. }
  552. .. rst-class:: classref-item-separator
  553. ----
  554. .. _class_TileSet_method_tile_get_texture:
  555. .. rst-class:: classref-method
  556. :ref:`Texture<class_Texture>` **tile_get_texture** **(** :ref:`int<class_int>` id **)** |const|
  557. Returns the tile's texture.
  558. .. rst-class:: classref-item-separator
  559. ----
  560. .. _class_TileSet_method_tile_get_texture_offset:
  561. .. rst-class:: classref-method
  562. :ref:`Vector2<class_Vector2>` **tile_get_texture_offset** **(** :ref:`int<class_int>` id **)** |const|
  563. Returns the texture offset of the tile.
  564. .. rst-class:: classref-item-separator
  565. ----
  566. .. _class_TileSet_method_tile_get_tile_mode:
  567. .. rst-class:: classref-method
  568. :ref:`TileMode<enum_TileSet_TileMode>` **tile_get_tile_mode** **(** :ref:`int<class_int>` id **)** |const|
  569. Returns the tile's :ref:`TileMode<enum_TileSet_TileMode>`.
  570. .. rst-class:: classref-item-separator
  571. ----
  572. .. _class_TileSet_method_tile_get_z_index:
  573. .. rst-class:: classref-method
  574. :ref:`int<class_int>` **tile_get_z_index** **(** :ref:`int<class_int>` id **)** |const|
  575. Returns the tile's Z index (drawing layer).
  576. .. rst-class:: classref-item-separator
  577. ----
  578. .. _class_TileSet_method_tile_set_light_occluder:
  579. .. rst-class:: classref-method
  580. void **tile_set_light_occluder** **(** :ref:`int<class_int>` id, :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` light_occluder **)**
  581. Sets a light occluder for the tile.
  582. .. rst-class:: classref-item-separator
  583. ----
  584. .. _class_TileSet_method_tile_set_material:
  585. .. rst-class:: classref-method
  586. void **tile_set_material** **(** :ref:`int<class_int>` id, :ref:`ShaderMaterial<class_ShaderMaterial>` material **)**
  587. Sets the tile's material.
  588. .. rst-class:: classref-item-separator
  589. ----
  590. .. _class_TileSet_method_tile_set_modulate:
  591. .. rst-class:: classref-method
  592. void **tile_set_modulate** **(** :ref:`int<class_int>` id, :ref:`Color<class_Color>` color **)**
  593. Sets the tile's modulation color.
  594. \ **Note:** Modulation is performed by setting the tile's vertex color. To access this in a shader, use ``COLOR`` rather than ``MODULATE`` (which instead accesses the :ref:`TileMap<class_TileMap>`'s :ref:`CanvasItem.modulate<class_CanvasItem_property_modulate>` property).
  595. .. rst-class:: classref-item-separator
  596. ----
  597. .. _class_TileSet_method_tile_set_name:
  598. .. rst-class:: classref-method
  599. void **tile_set_name** **(** :ref:`int<class_int>` id, :ref:`String<class_String>` name **)**
  600. Sets the tile's name.
  601. .. rst-class:: classref-item-separator
  602. ----
  603. .. _class_TileSet_method_tile_set_navigation_polygon:
  604. .. rst-class:: classref-method
  605. void **tile_set_navigation_polygon** **(** :ref:`int<class_int>` id, :ref:`NavigationPolygon<class_NavigationPolygon>` navigation_polygon **)**
  606. Sets the tile's navigation polygon.
  607. .. rst-class:: classref-item-separator
  608. ----
  609. .. _class_TileSet_method_tile_set_navigation_polygon_offset:
  610. .. rst-class:: classref-method
  611. void **tile_set_navigation_polygon_offset** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` navigation_polygon_offset **)**
  612. Sets an offset for the tile's navigation polygon.
  613. .. rst-class:: classref-item-separator
  614. ----
  615. .. _class_TileSet_method_tile_set_normal_map:
  616. .. rst-class:: classref-method
  617. void **tile_set_normal_map** **(** :ref:`int<class_int>` id, :ref:`Texture<class_Texture>` normal_map **)**
  618. Sets the tile's normal map texture.
  619. \ **Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page <http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates>`__ for a comparison of normal map coordinates expected by popular engines.
  620. .. rst-class:: classref-item-separator
  621. ----
  622. .. _class_TileSet_method_tile_set_occluder_offset:
  623. .. rst-class:: classref-method
  624. void **tile_set_occluder_offset** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` occluder_offset **)**
  625. Sets an offset for the tile's light occluder.
  626. .. rst-class:: classref-item-separator
  627. ----
  628. .. _class_TileSet_method_tile_set_region:
  629. .. rst-class:: classref-method
  630. void **tile_set_region** **(** :ref:`int<class_int>` id, :ref:`Rect2<class_Rect2>` region **)**
  631. Sets the tile's sub-region in the texture. This is common in texture atlases.
  632. .. rst-class:: classref-item-separator
  633. ----
  634. .. _class_TileSet_method_tile_set_shape:
  635. .. rst-class:: classref-method
  636. void **tile_set_shape** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`Shape2D<class_Shape2D>` shape **)**
  637. Sets a shape for the tile, enabling collision.
  638. .. rst-class:: classref-item-separator
  639. ----
  640. .. _class_TileSet_method_tile_set_shape_offset:
  641. .. rst-class:: classref-method
  642. void **tile_set_shape_offset** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`Vector2<class_Vector2>` shape_offset **)**
  643. Sets the offset of a tile's shape.
  644. .. rst-class:: classref-item-separator
  645. ----
  646. .. _class_TileSet_method_tile_set_shape_one_way:
  647. .. rst-class:: classref-method
  648. void **tile_set_shape_one_way** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`bool<class_bool>` one_way **)**
  649. Enables one-way collision on a tile's shape.
  650. .. rst-class:: classref-item-separator
  651. ----
  652. .. _class_TileSet_method_tile_set_shape_one_way_margin:
  653. .. rst-class:: classref-method
  654. void **tile_set_shape_one_way_margin** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`float<class_float>` one_way **)**
  655. .. container:: contribute
  656. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  657. .. rst-class:: classref-item-separator
  658. ----
  659. .. _class_TileSet_method_tile_set_shape_transform:
  660. .. rst-class:: classref-method
  661. void **tile_set_shape_transform** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` shape_id, :ref:`Transform2D<class_Transform2D>` shape_transform **)**
  662. Sets a :ref:`Transform2D<class_Transform2D>` on a tile's shape.
  663. .. rst-class:: classref-item-separator
  664. ----
  665. .. _class_TileSet_method_tile_set_shapes:
  666. .. rst-class:: classref-method
  667. void **tile_set_shapes** **(** :ref:`int<class_int>` id, :ref:`Array<class_Array>` shapes **)**
  668. Sets an array of shapes for the tile, enabling collision.
  669. .. rst-class:: classref-item-separator
  670. ----
  671. .. _class_TileSet_method_tile_set_texture:
  672. .. rst-class:: classref-method
  673. void **tile_set_texture** **(** :ref:`int<class_int>` id, :ref:`Texture<class_Texture>` texture **)**
  674. Sets the tile's texture.
  675. .. rst-class:: classref-item-separator
  676. ----
  677. .. _class_TileSet_method_tile_set_texture_offset:
  678. .. rst-class:: classref-method
  679. void **tile_set_texture_offset** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` texture_offset **)**
  680. Sets the tile's texture offset.
  681. .. rst-class:: classref-item-separator
  682. ----
  683. .. _class_TileSet_method_tile_set_tile_mode:
  684. .. rst-class:: classref-method
  685. void **tile_set_tile_mode** **(** :ref:`int<class_int>` id, :ref:`TileMode<enum_TileSet_TileMode>` tilemode **)**
  686. Sets the tile's :ref:`TileMode<enum_TileSet_TileMode>`.
  687. .. rst-class:: classref-item-separator
  688. ----
  689. .. _class_TileSet_method_tile_set_z_index:
  690. .. rst-class:: classref-method
  691. void **tile_set_z_index** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` z_index **)**
  692. Sets the tile's drawing index.
  693. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  694. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  695. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  696. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`