class_tileset.rst 112 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TileSet.xml.
  6. .. _class_TileSet:
  7. TileSet
  8. =======
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :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:`TileMapLayer<class_TileMapLayer>`. A TileSet handles a list of :ref:`TileSetSource<class_TileSetSource>`, each of them storing a set of tiles.
  15. Tiles can either be from a :ref:`TileSetAtlasSource<class_TileSetAtlasSource>`, which renders tiles out of a texture with support for physics, navigation, etc., or from a :ref:`TileSetScenesCollectionSource<class_TileSetScenesCollectionSource>`, which exposes scene-based tiles.
  16. Tiles are referenced by using three IDs: their source ID, their atlas coordinates ID, and their alternative tile ID.
  17. A TileSet can be configured so that its tiles expose more or fewer properties. To do so, the TileSet resources use property layers, which you can add or remove depending on your needs.
  18. For example, adding a physics layer allows giving collision shapes to your tiles. Each layer has dedicated properties (physics layer and mask), so you may add several TileSet physics layers for each type of collision you need.
  19. See the functions to add new layers for more information.
  20. .. rst-class:: classref-introduction-group
  21. Tutorials
  22. ---------
  23. - :doc:`Using Tilemaps <../tutorials/2d/using_tilemaps>`
  24. - `2D Platformer Demo <https://godotengine.org/asset-library/asset/2727>`__
  25. - `2D Isometric Demo <https://godotengine.org/asset-library/asset/2718>`__
  26. - `2D Hexagonal Demo <https://godotengine.org/asset-library/asset/2717>`__
  27. - `2D Grid-based Navigation with AStarGrid2D Demo <https://godotengine.org/asset-library/asset/2723>`__
  28. - `2D Role Playing Game (RPG) Demo <https://godotengine.org/asset-library/asset/2729>`__
  29. - `2D Kinematic Character Demo <https://godotengine.org/asset-library/asset/2719>`__
  30. .. rst-class:: classref-reftable-group
  31. Properties
  32. ----------
  33. .. table::
  34. :widths: auto
  35. +----------------------------------------------------+------------------------------------------------------------------+----------------------+
  36. | :ref:`TileLayout<enum_TileSet_TileLayout>` | :ref:`tile_layout<class_TileSet_property_tile_layout>` | ``0`` |
  37. +----------------------------------------------------+------------------------------------------------------------------+----------------------+
  38. | :ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>` | :ref:`tile_offset_axis<class_TileSet_property_tile_offset_axis>` | ``0`` |
  39. +----------------------------------------------------+------------------------------------------------------------------+----------------------+
  40. | :ref:`TileShape<enum_TileSet_TileShape>` | :ref:`tile_shape<class_TileSet_property_tile_shape>` | ``0`` |
  41. +----------------------------------------------------+------------------------------------------------------------------+----------------------+
  42. | :ref:`Vector2i<class_Vector2i>` | :ref:`tile_size<class_TileSet_property_tile_size>` | ``Vector2i(16, 16)`` |
  43. +----------------------------------------------------+------------------------------------------------------------------+----------------------+
  44. | :ref:`bool<class_bool>` | :ref:`uv_clipping<class_TileSet_property_uv_clipping>` | ``false`` |
  45. +----------------------------------------------------+------------------------------------------------------------------+----------------------+
  46. .. rst-class:: classref-reftable-group
  47. Methods
  48. -------
  49. .. table::
  50. :widths: auto
  51. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | |void| | :ref:`add_custom_data_layer<class_TileSet_method_add_custom_data_layer>`\ (\ to_position\: :ref:`int<class_int>` = -1\ ) |
  53. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | |void| | :ref:`add_navigation_layer<class_TileSet_method_add_navigation_layer>`\ (\ to_position\: :ref:`int<class_int>` = -1\ ) |
  55. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | |void| | :ref:`add_occlusion_layer<class_TileSet_method_add_occlusion_layer>`\ (\ to_position\: :ref:`int<class_int>` = -1\ ) |
  57. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`int<class_int>` | :ref:`add_pattern<class_TileSet_method_add_pattern>`\ (\ pattern\: :ref:`TileMapPattern<class_TileMapPattern>`, index\: :ref:`int<class_int>` = -1\ ) |
  59. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | |void| | :ref:`add_physics_layer<class_TileSet_method_add_physics_layer>`\ (\ to_position\: :ref:`int<class_int>` = -1\ ) |
  61. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`int<class_int>` | :ref:`add_source<class_TileSet_method_add_source>`\ (\ source\: :ref:`TileSetSource<class_TileSetSource>`, atlas_source_id_override\: :ref:`int<class_int>` = -1\ ) |
  63. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | |void| | :ref:`add_terrain<class_TileSet_method_add_terrain>`\ (\ terrain_set\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>` = -1\ ) |
  65. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | |void| | :ref:`add_terrain_set<class_TileSet_method_add_terrain_set>`\ (\ to_position\: :ref:`int<class_int>` = -1\ ) |
  67. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | |void| | :ref:`cleanup_invalid_tile_proxies<class_TileSet_method_cleanup_invalid_tile_proxies>`\ (\ ) |
  69. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | |void| | :ref:`clear_tile_proxies<class_TileSet_method_clear_tile_proxies>`\ (\ ) |
  71. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`Array<class_Array>` | :ref:`get_alternative_level_tile_proxy<class_TileSet_method_get_alternative_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) |
  73. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`Array<class_Array>` | :ref:`get_coords_level_tile_proxy<class_TileSet_method_get_coords_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) |
  75. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`int<class_int>` | :ref:`get_custom_data_layer_by_name<class_TileSet_method_get_custom_data_layer_by_name>`\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| |
  77. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`String<class_String>` | :ref:`get_custom_data_layer_name<class_TileSet_method_get_custom_data_layer_name>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
  79. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` | :ref:`get_custom_data_layer_type<class_TileSet_method_get_custom_data_layer_type>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
  81. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`int<class_int>` | :ref:`get_custom_data_layers_count<class_TileSet_method_get_custom_data_layers_count>`\ (\ ) |const| |
  83. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`get_navigation_layer_layer_value<class_TileSet_method_get_navigation_layer_layer_value>`\ (\ layer_index\: :ref:`int<class_int>`, layer_number\: :ref:`int<class_int>`\ ) |const| |
  85. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`int<class_int>` | :ref:`get_navigation_layer_layers<class_TileSet_method_get_navigation_layer_layers>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
  87. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`int<class_int>` | :ref:`get_navigation_layers_count<class_TileSet_method_get_navigation_layers_count>`\ (\ ) |const| |
  89. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`int<class_int>` | :ref:`get_next_source_id<class_TileSet_method_get_next_source_id>`\ (\ ) |const| |
  91. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`int<class_int>` | :ref:`get_occlusion_layer_light_mask<class_TileSet_method_get_occlusion_layer_light_mask>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
  93. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`bool<class_bool>` | :ref:`get_occlusion_layer_sdf_collision<class_TileSet_method_get_occlusion_layer_sdf_collision>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
  95. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`int<class_int>` | :ref:`get_occlusion_layers_count<class_TileSet_method_get_occlusion_layers_count>`\ (\ ) |const| |
  97. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`TileMapPattern<class_TileMapPattern>` | :ref:`get_pattern<class_TileSet_method_get_pattern>`\ (\ index\: :ref:`int<class_int>` = -1\ ) |
  99. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`int<class_int>` | :ref:`get_patterns_count<class_TileSet_method_get_patterns_count>`\ (\ ) |
  101. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`int<class_int>` | :ref:`get_physics_layer_collision_layer<class_TileSet_method_get_physics_layer_collision_layer>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
  103. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`int<class_int>` | :ref:`get_physics_layer_collision_mask<class_TileSet_method_get_physics_layer_collision_mask>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
  105. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`float<class_float>` | :ref:`get_physics_layer_collision_priority<class_TileSet_method_get_physics_layer_collision_priority>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
  107. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`PhysicsMaterial<class_PhysicsMaterial>` | :ref:`get_physics_layer_physics_material<class_TileSet_method_get_physics_layer_physics_material>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
  109. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`int<class_int>` | :ref:`get_physics_layers_count<class_TileSet_method_get_physics_layers_count>`\ (\ ) |const| |
  111. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`TileSetSource<class_TileSetSource>` | :ref:`get_source<class_TileSet_method_get_source>`\ (\ source_id\: :ref:`int<class_int>`\ ) |const| |
  113. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`int<class_int>` | :ref:`get_source_count<class_TileSet_method_get_source_count>`\ (\ ) |const| |
  115. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`int<class_int>` | :ref:`get_source_id<class_TileSet_method_get_source_id>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
  117. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`int<class_int>` | :ref:`get_source_level_tile_proxy<class_TileSet_method_get_source_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`\ ) |
  119. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`Color<class_Color>` | :ref:`get_terrain_color<class_TileSet_method_get_terrain_color>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) |const| |
  121. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`String<class_String>` | :ref:`get_terrain_name<class_TileSet_method_get_terrain_name>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) |const| |
  123. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`TerrainMode<enum_TileSet_TerrainMode>` | :ref:`get_terrain_set_mode<class_TileSet_method_get_terrain_set_mode>`\ (\ terrain_set\: :ref:`int<class_int>`\ ) |const| |
  125. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`int<class_int>` | :ref:`get_terrain_sets_count<class_TileSet_method_get_terrain_sets_count>`\ (\ ) |const| |
  127. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`int<class_int>` | :ref:`get_terrains_count<class_TileSet_method_get_terrains_count>`\ (\ terrain_set\: :ref:`int<class_int>`\ ) |const| |
  129. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`bool<class_bool>` | :ref:`has_alternative_level_tile_proxy<class_TileSet_method_has_alternative_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) |
  131. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`bool<class_bool>` | :ref:`has_coords_level_tile_proxy<class_TileSet_method_has_coords_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) |
  133. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`bool<class_bool>` | :ref:`has_custom_data_layer_by_name<class_TileSet_method_has_custom_data_layer_by_name>`\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| |
  135. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`bool<class_bool>` | :ref:`has_source<class_TileSet_method_has_source>`\ (\ source_id\: :ref:`int<class_int>`\ ) |const| |
  137. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | :ref:`bool<class_bool>` | :ref:`has_source_level_tile_proxy<class_TileSet_method_has_source_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`\ ) |
  139. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | :ref:`Array<class_Array>` | :ref:`map_tile_proxy<class_TileSet_method_map_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) |const| |
  141. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | |void| | :ref:`move_custom_data_layer<class_TileSet_method_move_custom_data_layer>`\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
  143. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | |void| | :ref:`move_navigation_layer<class_TileSet_method_move_navigation_layer>`\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
  145. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | |void| | :ref:`move_occlusion_layer<class_TileSet_method_move_occlusion_layer>`\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
  147. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | |void| | :ref:`move_physics_layer<class_TileSet_method_move_physics_layer>`\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
  149. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | |void| | :ref:`move_terrain<class_TileSet_method_move_terrain>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
  151. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | |void| | :ref:`move_terrain_set<class_TileSet_method_move_terrain_set>`\ (\ terrain_set\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
  153. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | |void| | :ref:`remove_alternative_level_tile_proxy<class_TileSet_method_remove_alternative_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) |
  155. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | |void| | :ref:`remove_coords_level_tile_proxy<class_TileSet_method_remove_coords_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) |
  157. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | |void| | :ref:`remove_custom_data_layer<class_TileSet_method_remove_custom_data_layer>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |
  159. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | |void| | :ref:`remove_navigation_layer<class_TileSet_method_remove_navigation_layer>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |
  161. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | |void| | :ref:`remove_occlusion_layer<class_TileSet_method_remove_occlusion_layer>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |
  163. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | |void| | :ref:`remove_pattern<class_TileSet_method_remove_pattern>`\ (\ index\: :ref:`int<class_int>`\ ) |
  165. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | |void| | :ref:`remove_physics_layer<class_TileSet_method_remove_physics_layer>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |
  167. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | |void| | :ref:`remove_source<class_TileSet_method_remove_source>`\ (\ source_id\: :ref:`int<class_int>`\ ) |
  169. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | |void| | :ref:`remove_source_level_tile_proxy<class_TileSet_method_remove_source_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`\ ) |
  171. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | |void| | :ref:`remove_terrain<class_TileSet_method_remove_terrain>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) |
  173. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | |void| | :ref:`remove_terrain_set<class_TileSet_method_remove_terrain_set>`\ (\ terrain_set\: :ref:`int<class_int>`\ ) |
  175. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | |void| | :ref:`set_alternative_level_tile_proxy<class_TileSet_method_set_alternative_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`, source_to\: :ref:`int<class_int>`, coords_to\: :ref:`Vector2i<class_Vector2i>`, alternative_to\: :ref:`int<class_int>`\ ) |
  177. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | |void| | :ref:`set_coords_level_tile_proxy<class_TileSet_method_set_coords_level_tile_proxy>`\ (\ p_source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, source_to\: :ref:`int<class_int>`, coords_to\: :ref:`Vector2i<class_Vector2i>`\ ) |
  179. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | |void| | :ref:`set_custom_data_layer_name<class_TileSet_method_set_custom_data_layer_name>`\ (\ layer_index\: :ref:`int<class_int>`, layer_name\: :ref:`String<class_String>`\ ) |
  181. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | |void| | :ref:`set_custom_data_layer_type<class_TileSet_method_set_custom_data_layer_type>`\ (\ layer_index\: :ref:`int<class_int>`, layer_type\: :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>`\ ) |
  183. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | |void| | :ref:`set_navigation_layer_layer_value<class_TileSet_method_set_navigation_layer_layer_value>`\ (\ layer_index\: :ref:`int<class_int>`, layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) |
  185. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | |void| | :ref:`set_navigation_layer_layers<class_TileSet_method_set_navigation_layer_layers>`\ (\ layer_index\: :ref:`int<class_int>`, layers\: :ref:`int<class_int>`\ ) |
  187. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | |void| | :ref:`set_occlusion_layer_light_mask<class_TileSet_method_set_occlusion_layer_light_mask>`\ (\ layer_index\: :ref:`int<class_int>`, light_mask\: :ref:`int<class_int>`\ ) |
  189. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | |void| | :ref:`set_occlusion_layer_sdf_collision<class_TileSet_method_set_occlusion_layer_sdf_collision>`\ (\ layer_index\: :ref:`int<class_int>`, sdf_collision\: :ref:`bool<class_bool>`\ ) |
  191. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | |void| | :ref:`set_physics_layer_collision_layer<class_TileSet_method_set_physics_layer_collision_layer>`\ (\ layer_index\: :ref:`int<class_int>`, layer\: :ref:`int<class_int>`\ ) |
  193. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | |void| | :ref:`set_physics_layer_collision_mask<class_TileSet_method_set_physics_layer_collision_mask>`\ (\ layer_index\: :ref:`int<class_int>`, mask\: :ref:`int<class_int>`\ ) |
  195. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | |void| | :ref:`set_physics_layer_collision_priority<class_TileSet_method_set_physics_layer_collision_priority>`\ (\ layer_index\: :ref:`int<class_int>`, priority\: :ref:`float<class_float>`\ ) |
  197. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | |void| | :ref:`set_physics_layer_physics_material<class_TileSet_method_set_physics_layer_physics_material>`\ (\ layer_index\: :ref:`int<class_int>`, physics_material\: :ref:`PhysicsMaterial<class_PhysicsMaterial>`\ ) |
  199. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | |void| | :ref:`set_source_id<class_TileSet_method_set_source_id>`\ (\ source_id\: :ref:`int<class_int>`, new_source_id\: :ref:`int<class_int>`\ ) |
  201. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | |void| | :ref:`set_source_level_tile_proxy<class_TileSet_method_set_source_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, source_to\: :ref:`int<class_int>`\ ) |
  203. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | |void| | :ref:`set_terrain_color<class_TileSet_method_set_terrain_color>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
  205. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | |void| | :ref:`set_terrain_name<class_TileSet_method_set_terrain_name>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) |
  207. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | |void| | :ref:`set_terrain_set_mode<class_TileSet_method_set_terrain_set_mode>`\ (\ terrain_set\: :ref:`int<class_int>`, mode\: :ref:`TerrainMode<enum_TileSet_TerrainMode>`\ ) |
  209. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. .. rst-class:: classref-section-separator
  211. ----
  212. .. rst-class:: classref-descriptions-group
  213. Enumerations
  214. ------------
  215. .. _enum_TileSet_TileShape:
  216. .. rst-class:: classref-enumeration
  217. enum **TileShape**: :ref:`๐Ÿ”—<enum_TileSet_TileShape>`
  218. .. _class_TileSet_constant_TILE_SHAPE_SQUARE:
  219. .. rst-class:: classref-enumeration-constant
  220. :ref:`TileShape<enum_TileSet_TileShape>` **TILE_SHAPE_SQUARE** = ``0``
  221. Rectangular tile shape.
  222. .. _class_TileSet_constant_TILE_SHAPE_ISOMETRIC:
  223. .. rst-class:: classref-enumeration-constant
  224. :ref:`TileShape<enum_TileSet_TileShape>` **TILE_SHAPE_ISOMETRIC** = ``1``
  225. Diamond tile shape (for isometric look).
  226. \ **Note:** Isometric **TileSet** works best if :ref:`TileMap<class_TileMap>` and all its layers have Y-sort enabled.
  227. .. _class_TileSet_constant_TILE_SHAPE_HALF_OFFSET_SQUARE:
  228. .. rst-class:: classref-enumeration-constant
  229. :ref:`TileShape<enum_TileSet_TileShape>` **TILE_SHAPE_HALF_OFFSET_SQUARE** = ``2``
  230. Rectangular tile shape with one row/column out of two offset by half a tile.
  231. .. _class_TileSet_constant_TILE_SHAPE_HEXAGON:
  232. .. rst-class:: classref-enumeration-constant
  233. :ref:`TileShape<enum_TileSet_TileShape>` **TILE_SHAPE_HEXAGON** = ``3``
  234. Hexagonal tile shape.
  235. .. rst-class:: classref-item-separator
  236. ----
  237. .. _enum_TileSet_TileLayout:
  238. .. rst-class:: classref-enumeration
  239. enum **TileLayout**: :ref:`๐Ÿ”—<enum_TileSet_TileLayout>`
  240. .. _class_TileSet_constant_TILE_LAYOUT_STACKED:
  241. .. rst-class:: classref-enumeration-constant
  242. :ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_STACKED** = ``0``
  243. Tile coordinates layout where both axis stay consistent with their respective local horizontal and vertical axis.
  244. .. _class_TileSet_constant_TILE_LAYOUT_STACKED_OFFSET:
  245. .. rst-class:: classref-enumeration-constant
  246. :ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_STACKED_OFFSET** = ``1``
  247. Same as :ref:`TILE_LAYOUT_STACKED<class_TileSet_constant_TILE_LAYOUT_STACKED>`, but the first half-offset is negative instead of positive.
  248. .. _class_TileSet_constant_TILE_LAYOUT_STAIRS_RIGHT:
  249. .. rst-class:: classref-enumeration-constant
  250. :ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_STAIRS_RIGHT** = ``2``
  251. Tile coordinates layout where the horizontal axis stay horizontal, and the vertical one goes down-right.
  252. .. _class_TileSet_constant_TILE_LAYOUT_STAIRS_DOWN:
  253. .. rst-class:: classref-enumeration-constant
  254. :ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_STAIRS_DOWN** = ``3``
  255. Tile coordinates layout where the vertical axis stay vertical, and the horizontal one goes down-right.
  256. .. _class_TileSet_constant_TILE_LAYOUT_DIAMOND_RIGHT:
  257. .. rst-class:: classref-enumeration-constant
  258. :ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_DIAMOND_RIGHT** = ``4``
  259. Tile coordinates layout where the horizontal axis goes up-right, and the vertical one goes down-right.
  260. .. _class_TileSet_constant_TILE_LAYOUT_DIAMOND_DOWN:
  261. .. rst-class:: classref-enumeration-constant
  262. :ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_DIAMOND_DOWN** = ``5``
  263. Tile coordinates layout where the horizontal axis goes down-right, and the vertical one goes down-left.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _enum_TileSet_TileOffsetAxis:
  267. .. rst-class:: classref-enumeration
  268. enum **TileOffsetAxis**: :ref:`๐Ÿ”—<enum_TileSet_TileOffsetAxis>`
  269. .. _class_TileSet_constant_TILE_OFFSET_AXIS_HORIZONTAL:
  270. .. rst-class:: classref-enumeration-constant
  271. :ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>` **TILE_OFFSET_AXIS_HORIZONTAL** = ``0``
  272. Horizontal half-offset.
  273. .. _class_TileSet_constant_TILE_OFFSET_AXIS_VERTICAL:
  274. .. rst-class:: classref-enumeration-constant
  275. :ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>` **TILE_OFFSET_AXIS_VERTICAL** = ``1``
  276. Vertical half-offset.
  277. .. rst-class:: classref-item-separator
  278. ----
  279. .. _enum_TileSet_CellNeighbor:
  280. .. rst-class:: classref-enumeration
  281. enum **CellNeighbor**: :ref:`๐Ÿ”—<enum_TileSet_CellNeighbor>`
  282. .. _class_TileSet_constant_CELL_NEIGHBOR_RIGHT_SIDE:
  283. .. rst-class:: classref-enumeration-constant
  284. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_RIGHT_SIDE** = ``0``
  285. Neighbor on the right side.
  286. .. _class_TileSet_constant_CELL_NEIGHBOR_RIGHT_CORNER:
  287. .. rst-class:: classref-enumeration-constant
  288. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_RIGHT_CORNER** = ``1``
  289. Neighbor in the right corner.
  290. .. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE:
  291. .. rst-class:: classref-enumeration-constant
  292. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE** = ``2``
  293. Neighbor on the bottom right side.
  294. .. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER:
  295. .. rst-class:: classref-enumeration-constant
  296. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER** = ``3``
  297. Neighbor in the bottom right corner.
  298. .. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_SIDE:
  299. .. rst-class:: classref-enumeration-constant
  300. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_SIDE** = ``4``
  301. Neighbor on the bottom side.
  302. .. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_CORNER:
  303. .. rst-class:: classref-enumeration-constant
  304. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_CORNER** = ``5``
  305. Neighbor in the bottom corner.
  306. .. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_LEFT_SIDE:
  307. .. rst-class:: classref-enumeration-constant
  308. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_LEFT_SIDE** = ``6``
  309. Neighbor on the bottom left side.
  310. .. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_LEFT_CORNER:
  311. .. rst-class:: classref-enumeration-constant
  312. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_LEFT_CORNER** = ``7``
  313. Neighbor in the bottom left corner.
  314. .. _class_TileSet_constant_CELL_NEIGHBOR_LEFT_SIDE:
  315. .. rst-class:: classref-enumeration-constant
  316. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_LEFT_SIDE** = ``8``
  317. Neighbor on the left side.
  318. .. _class_TileSet_constant_CELL_NEIGHBOR_LEFT_CORNER:
  319. .. rst-class:: classref-enumeration-constant
  320. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_LEFT_CORNER** = ``9``
  321. Neighbor in the left corner.
  322. .. _class_TileSet_constant_CELL_NEIGHBOR_TOP_LEFT_SIDE:
  323. .. rst-class:: classref-enumeration-constant
  324. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_LEFT_SIDE** = ``10``
  325. Neighbor on the top left side.
  326. .. _class_TileSet_constant_CELL_NEIGHBOR_TOP_LEFT_CORNER:
  327. .. rst-class:: classref-enumeration-constant
  328. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_LEFT_CORNER** = ``11``
  329. Neighbor in the top left corner.
  330. .. _class_TileSet_constant_CELL_NEIGHBOR_TOP_SIDE:
  331. .. rst-class:: classref-enumeration-constant
  332. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_SIDE** = ``12``
  333. Neighbor on the top side.
  334. .. _class_TileSet_constant_CELL_NEIGHBOR_TOP_CORNER:
  335. .. rst-class:: classref-enumeration-constant
  336. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_CORNER** = ``13``
  337. Neighbor in the top corner.
  338. .. _class_TileSet_constant_CELL_NEIGHBOR_TOP_RIGHT_SIDE:
  339. .. rst-class:: classref-enumeration-constant
  340. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_RIGHT_SIDE** = ``14``
  341. Neighbor on the top right side.
  342. .. _class_TileSet_constant_CELL_NEIGHBOR_TOP_RIGHT_CORNER:
  343. .. rst-class:: classref-enumeration-constant
  344. :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_RIGHT_CORNER** = ``15``
  345. Neighbor in the top right corner.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _enum_TileSet_TerrainMode:
  349. .. rst-class:: classref-enumeration
  350. enum **TerrainMode**: :ref:`๐Ÿ”—<enum_TileSet_TerrainMode>`
  351. .. _class_TileSet_constant_TERRAIN_MODE_MATCH_CORNERS_AND_SIDES:
  352. .. rst-class:: classref-enumeration-constant
  353. :ref:`TerrainMode<enum_TileSet_TerrainMode>` **TERRAIN_MODE_MATCH_CORNERS_AND_SIDES** = ``0``
  354. Requires both corners and side to match with neighboring tiles' terrains.
  355. .. _class_TileSet_constant_TERRAIN_MODE_MATCH_CORNERS:
  356. .. rst-class:: classref-enumeration-constant
  357. :ref:`TerrainMode<enum_TileSet_TerrainMode>` **TERRAIN_MODE_MATCH_CORNERS** = ``1``
  358. Requires corners to match with neighboring tiles' terrains.
  359. .. _class_TileSet_constant_TERRAIN_MODE_MATCH_SIDES:
  360. .. rst-class:: classref-enumeration-constant
  361. :ref:`TerrainMode<enum_TileSet_TerrainMode>` **TERRAIN_MODE_MATCH_SIDES** = ``2``
  362. Requires sides to match with neighboring tiles' terrains.
  363. .. rst-class:: classref-section-separator
  364. ----
  365. .. rst-class:: classref-descriptions-group
  366. Property Descriptions
  367. ---------------------
  368. .. _class_TileSet_property_tile_layout:
  369. .. rst-class:: classref-property
  370. :ref:`TileLayout<enum_TileSet_TileLayout>` **tile_layout** = ``0`` :ref:`๐Ÿ”—<class_TileSet_property_tile_layout>`
  371. .. rst-class:: classref-property-setget
  372. - |void| **set_tile_layout**\ (\ value\: :ref:`TileLayout<enum_TileSet_TileLayout>`\ )
  373. - :ref:`TileLayout<enum_TileSet_TileLayout>` **get_tile_layout**\ (\ )
  374. For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), changes the way tiles are indexed in the TileMap grid.
  375. .. rst-class:: classref-item-separator
  376. ----
  377. .. _class_TileSet_property_tile_offset_axis:
  378. .. rst-class:: classref-property
  379. :ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>` **tile_offset_axis** = ``0`` :ref:`๐Ÿ”—<class_TileSet_property_tile_offset_axis>`
  380. .. rst-class:: classref-property-setget
  381. - |void| **set_tile_offset_axis**\ (\ value\: :ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>`\ )
  382. - :ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>` **get_tile_offset_axis**\ (\ )
  383. For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), determines the offset axis.
  384. .. rst-class:: classref-item-separator
  385. ----
  386. .. _class_TileSet_property_tile_shape:
  387. .. rst-class:: classref-property
  388. :ref:`TileShape<enum_TileSet_TileShape>` **tile_shape** = ``0`` :ref:`๐Ÿ”—<class_TileSet_property_tile_shape>`
  389. .. rst-class:: classref-property-setget
  390. - |void| **set_tile_shape**\ (\ value\: :ref:`TileShape<enum_TileSet_TileShape>`\ )
  391. - :ref:`TileShape<enum_TileSet_TileShape>` **get_tile_shape**\ (\ )
  392. The tile shape.
  393. .. rst-class:: classref-item-separator
  394. ----
  395. .. _class_TileSet_property_tile_size:
  396. .. rst-class:: classref-property
  397. :ref:`Vector2i<class_Vector2i>` **tile_size** = ``Vector2i(16, 16)`` :ref:`๐Ÿ”—<class_TileSet_property_tile_size>`
  398. .. rst-class:: classref-property-setget
  399. - |void| **set_tile_size**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
  400. - :ref:`Vector2i<class_Vector2i>` **get_tile_size**\ (\ )
  401. The tile size, in pixels. For all tile shapes, this size corresponds to the encompassing rectangle of the tile shape. This is thus the minimal cell size required in an atlas.
  402. .. rst-class:: classref-item-separator
  403. ----
  404. .. _class_TileSet_property_uv_clipping:
  405. .. rst-class:: classref-property
  406. :ref:`bool<class_bool>` **uv_clipping** = ``false`` :ref:`๐Ÿ”—<class_TileSet_property_uv_clipping>`
  407. .. rst-class:: classref-property-setget
  408. - |void| **set_uv_clipping**\ (\ value\: :ref:`bool<class_bool>`\ )
  409. - :ref:`bool<class_bool>` **is_uv_clipping**\ (\ )
  410. Enables/Disable uv clipping when rendering the tiles.
  411. .. rst-class:: classref-section-separator
  412. ----
  413. .. rst-class:: classref-descriptions-group
  414. Method Descriptions
  415. -------------------
  416. .. _class_TileSet_method_add_custom_data_layer:
  417. .. rst-class:: classref-method
  418. |void| **add_custom_data_layer**\ (\ to_position\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TileSet_method_add_custom_data_layer>`
  419. Adds a custom data layer to the TileSet at the given position ``to_position`` in the array. If ``to_position`` is -1, adds it at the end of the array.
  420. Custom data layers allow assigning custom properties to atlas tiles.
  421. .. rst-class:: classref-item-separator
  422. ----
  423. .. _class_TileSet_method_add_navigation_layer:
  424. .. rst-class:: classref-method
  425. |void| **add_navigation_layer**\ (\ to_position\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TileSet_method_add_navigation_layer>`
  426. Adds a navigation layer to the TileSet at the given position ``to_position`` in the array. If ``to_position`` is -1, adds it at the end of the array.
  427. Navigation layers allow assigning a navigable area to atlas tiles.
  428. .. rst-class:: classref-item-separator
  429. ----
  430. .. _class_TileSet_method_add_occlusion_layer:
  431. .. rst-class:: classref-method
  432. |void| **add_occlusion_layer**\ (\ to_position\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TileSet_method_add_occlusion_layer>`
  433. Adds an occlusion layer to the TileSet at the given position ``to_position`` in the array. If ``to_position`` is -1, adds it at the end of the array.
  434. Occlusion layers allow assigning occlusion polygons to atlas tiles.
  435. .. rst-class:: classref-item-separator
  436. ----
  437. .. _class_TileSet_method_add_pattern:
  438. .. rst-class:: classref-method
  439. :ref:`int<class_int>` **add_pattern**\ (\ pattern\: :ref:`TileMapPattern<class_TileMapPattern>`, index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TileSet_method_add_pattern>`
  440. Adds a :ref:`TileMapPattern<class_TileMapPattern>` to be stored in the TileSet resource. If provided, insert it at the given ``index``.
  441. .. rst-class:: classref-item-separator
  442. ----
  443. .. _class_TileSet_method_add_physics_layer:
  444. .. rst-class:: classref-method
  445. |void| **add_physics_layer**\ (\ to_position\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TileSet_method_add_physics_layer>`
  446. Adds a physics layer to the TileSet at the given position ``to_position`` in the array. If ``to_position`` is -1, adds it at the end of the array.
  447. Physics layers allow assigning collision polygons to atlas tiles.
  448. .. rst-class:: classref-item-separator
  449. ----
  450. .. _class_TileSet_method_add_source:
  451. .. rst-class:: classref-method
  452. :ref:`int<class_int>` **add_source**\ (\ source\: :ref:`TileSetSource<class_TileSetSource>`, atlas_source_id_override\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TileSet_method_add_source>`
  453. Adds a :ref:`TileSetSource<class_TileSetSource>` to the TileSet. If ``atlas_source_id_override`` is not -1, also set its source ID. Otherwise, a unique identifier is automatically generated.
  454. The function returns the added source ID or -1 if the source could not be added.
  455. \ **Warning:** A source cannot belong to two TileSets at the same time. If the added source was attached to another **TileSet**, it will be removed from that one.
  456. .. rst-class:: classref-item-separator
  457. ----
  458. .. _class_TileSet_method_add_terrain:
  459. .. rst-class:: classref-method
  460. |void| **add_terrain**\ (\ terrain_set\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TileSet_method_add_terrain>`
  461. Adds a new terrain to the given terrain set ``terrain_set`` at the given position ``to_position`` in the array. If ``to_position`` is -1, adds it at the end of the array.
  462. .. rst-class:: classref-item-separator
  463. ----
  464. .. _class_TileSet_method_add_terrain_set:
  465. .. rst-class:: classref-method
  466. |void| **add_terrain_set**\ (\ to_position\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TileSet_method_add_terrain_set>`
  467. Adds a new terrain set at the given position ``to_position`` in the array. If ``to_position`` is -1, adds it at the end of the array.
  468. .. rst-class:: classref-item-separator
  469. ----
  470. .. _class_TileSet_method_cleanup_invalid_tile_proxies:
  471. .. rst-class:: classref-method
  472. |void| **cleanup_invalid_tile_proxies**\ (\ ) :ref:`๐Ÿ”—<class_TileSet_method_cleanup_invalid_tile_proxies>`
  473. Clears tile proxies pointing to invalid tiles.
  474. .. rst-class:: classref-item-separator
  475. ----
  476. .. _class_TileSet_method_clear_tile_proxies:
  477. .. rst-class:: classref-method
  478. |void| **clear_tile_proxies**\ (\ ) :ref:`๐Ÿ”—<class_TileSet_method_clear_tile_proxies>`
  479. Clears all tile proxies.
  480. .. rst-class:: classref-item-separator
  481. ----
  482. .. _class_TileSet_method_get_alternative_level_tile_proxy:
  483. .. rst-class:: classref-method
  484. :ref:`Array<class_Array>` **get_alternative_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_get_alternative_level_tile_proxy>`
  485. Returns the alternative-level proxy for the given identifiers. The returned array contains the three proxie's target identifiers (source ID, atlas coords ID and alternative tile ID).
  486. If the TileSet has no proxy for the given identifiers, returns an empty Array.
  487. .. rst-class:: classref-item-separator
  488. ----
  489. .. _class_TileSet_method_get_coords_level_tile_proxy:
  490. .. rst-class:: classref-method
  491. :ref:`Array<class_Array>` **get_coords_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_get_coords_level_tile_proxy>`
  492. Returns the coordinate-level proxy for the given identifiers. The returned array contains the two target identifiers of the proxy (source ID and atlas coordinates ID).
  493. If the TileSet has no proxy for the given identifiers, returns an empty Array.
  494. .. rst-class:: classref-item-separator
  495. ----
  496. .. _class_TileSet_method_get_custom_data_layer_by_name:
  497. .. rst-class:: classref-method
  498. :ref:`int<class_int>` **get_custom_data_layer_by_name**\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_custom_data_layer_by_name>`
  499. Returns the index of the custom data layer identified by the given name.
  500. .. rst-class:: classref-item-separator
  501. ----
  502. .. _class_TileSet_method_get_custom_data_layer_name:
  503. .. rst-class:: classref-method
  504. :ref:`String<class_String>` **get_custom_data_layer_name**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_custom_data_layer_name>`
  505. Returns the name of the custom data layer identified by the given index.
  506. .. rst-class:: classref-item-separator
  507. ----
  508. .. _class_TileSet_method_get_custom_data_layer_type:
  509. .. rst-class:: classref-method
  510. :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **get_custom_data_layer_type**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_custom_data_layer_type>`
  511. Returns the type of the custom data layer identified by the given index.
  512. .. rst-class:: classref-item-separator
  513. ----
  514. .. _class_TileSet_method_get_custom_data_layers_count:
  515. .. rst-class:: classref-method
  516. :ref:`int<class_int>` **get_custom_data_layers_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_custom_data_layers_count>`
  517. Returns the custom data layers count.
  518. .. rst-class:: classref-item-separator
  519. ----
  520. .. _class_TileSet_method_get_navigation_layer_layer_value:
  521. .. rst-class:: classref-method
  522. :ref:`bool<class_bool>` **get_navigation_layer_layer_value**\ (\ layer_index\: :ref:`int<class_int>`, layer_number\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_navigation_layer_layer_value>`
  523. Returns whether or not the specified navigation layer of the TileSet navigation data layer identified by the given ``layer_index`` is enabled, given a navigation_layers ``layer_number`` between 1 and 32.
  524. .. rst-class:: classref-item-separator
  525. ----
  526. .. _class_TileSet_method_get_navigation_layer_layers:
  527. .. rst-class:: classref-method
  528. :ref:`int<class_int>` **get_navigation_layer_layers**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_navigation_layer_layers>`
  529. Returns the navigation layers (as in the Navigation server) of the given TileSet navigation layer.
  530. .. rst-class:: classref-item-separator
  531. ----
  532. .. _class_TileSet_method_get_navigation_layers_count:
  533. .. rst-class:: classref-method
  534. :ref:`int<class_int>` **get_navigation_layers_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_navigation_layers_count>`
  535. Returns the navigation layers count.
  536. .. rst-class:: classref-item-separator
  537. ----
  538. .. _class_TileSet_method_get_next_source_id:
  539. .. rst-class:: classref-method
  540. :ref:`int<class_int>` **get_next_source_id**\ (\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_next_source_id>`
  541. Returns a new unused source ID. This generated ID is the same that a call to :ref:`add_source<class_TileSet_method_add_source>` would return.
  542. .. rst-class:: classref-item-separator
  543. ----
  544. .. _class_TileSet_method_get_occlusion_layer_light_mask:
  545. .. rst-class:: classref-method
  546. :ref:`int<class_int>` **get_occlusion_layer_light_mask**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_occlusion_layer_light_mask>`
  547. Returns the light mask of the occlusion layer.
  548. .. rst-class:: classref-item-separator
  549. ----
  550. .. _class_TileSet_method_get_occlusion_layer_sdf_collision:
  551. .. rst-class:: classref-method
  552. :ref:`bool<class_bool>` **get_occlusion_layer_sdf_collision**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_occlusion_layer_sdf_collision>`
  553. Returns if the occluders from this layer use ``sdf_collision``.
  554. .. rst-class:: classref-item-separator
  555. ----
  556. .. _class_TileSet_method_get_occlusion_layers_count:
  557. .. rst-class:: classref-method
  558. :ref:`int<class_int>` **get_occlusion_layers_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_occlusion_layers_count>`
  559. Returns the occlusion layers count.
  560. .. rst-class:: classref-item-separator
  561. ----
  562. .. _class_TileSet_method_get_pattern:
  563. .. rst-class:: classref-method
  564. :ref:`TileMapPattern<class_TileMapPattern>` **get_pattern**\ (\ index\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_TileSet_method_get_pattern>`
  565. Returns the :ref:`TileMapPattern<class_TileMapPattern>` at the given ``index``.
  566. .. rst-class:: classref-item-separator
  567. ----
  568. .. _class_TileSet_method_get_patterns_count:
  569. .. rst-class:: classref-method
  570. :ref:`int<class_int>` **get_patterns_count**\ (\ ) :ref:`๐Ÿ”—<class_TileSet_method_get_patterns_count>`
  571. Returns the number of :ref:`TileMapPattern<class_TileMapPattern>` this tile set handles.
  572. .. rst-class:: classref-item-separator
  573. ----
  574. .. _class_TileSet_method_get_physics_layer_collision_layer:
  575. .. rst-class:: classref-method
  576. :ref:`int<class_int>` **get_physics_layer_collision_layer**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_physics_layer_collision_layer>`
  577. Returns the collision layer (as in the physics server) bodies on the given TileSet's physics layer are in.
  578. .. rst-class:: classref-item-separator
  579. ----
  580. .. _class_TileSet_method_get_physics_layer_collision_mask:
  581. .. rst-class:: classref-method
  582. :ref:`int<class_int>` **get_physics_layer_collision_mask**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_physics_layer_collision_mask>`
  583. Returns the collision mask of bodies on the given TileSet's physics layer.
  584. .. rst-class:: classref-item-separator
  585. ----
  586. .. _class_TileSet_method_get_physics_layer_collision_priority:
  587. .. rst-class:: classref-method
  588. :ref:`float<class_float>` **get_physics_layer_collision_priority**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_physics_layer_collision_priority>`
  589. Returns the collision priority of bodies on the given TileSet's physics layer.
  590. .. rst-class:: classref-item-separator
  591. ----
  592. .. _class_TileSet_method_get_physics_layer_physics_material:
  593. .. rst-class:: classref-method
  594. :ref:`PhysicsMaterial<class_PhysicsMaterial>` **get_physics_layer_physics_material**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_physics_layer_physics_material>`
  595. Returns the physics material of bodies on the given TileSet's physics layer.
  596. .. rst-class:: classref-item-separator
  597. ----
  598. .. _class_TileSet_method_get_physics_layers_count:
  599. .. rst-class:: classref-method
  600. :ref:`int<class_int>` **get_physics_layers_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_physics_layers_count>`
  601. Returns the physics layers count.
  602. .. rst-class:: classref-item-separator
  603. ----
  604. .. _class_TileSet_method_get_source:
  605. .. rst-class:: classref-method
  606. :ref:`TileSetSource<class_TileSetSource>` **get_source**\ (\ source_id\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_source>`
  607. Returns the :ref:`TileSetSource<class_TileSetSource>` with ID ``source_id``.
  608. .. rst-class:: classref-item-separator
  609. ----
  610. .. _class_TileSet_method_get_source_count:
  611. .. rst-class:: classref-method
  612. :ref:`int<class_int>` **get_source_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_source_count>`
  613. Returns the number of :ref:`TileSetSource<class_TileSetSource>` in this TileSet.
  614. .. rst-class:: classref-item-separator
  615. ----
  616. .. _class_TileSet_method_get_source_id:
  617. .. rst-class:: classref-method
  618. :ref:`int<class_int>` **get_source_id**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_source_id>`
  619. Returns the source ID for source with index ``index``.
  620. .. rst-class:: classref-item-separator
  621. ----
  622. .. _class_TileSet_method_get_source_level_tile_proxy:
  623. .. rst-class:: classref-method
  624. :ref:`int<class_int>` **get_source_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_get_source_level_tile_proxy>`
  625. Returns the source-level proxy for the given source identifier.
  626. If the TileSet has no proxy for the given identifier, returns -1.
  627. .. rst-class:: classref-item-separator
  628. ----
  629. .. _class_TileSet_method_get_terrain_color:
  630. .. rst-class:: classref-method
  631. :ref:`Color<class_Color>` **get_terrain_color**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_terrain_color>`
  632. Returns a terrain's color.
  633. .. rst-class:: classref-item-separator
  634. ----
  635. .. _class_TileSet_method_get_terrain_name:
  636. .. rst-class:: classref-method
  637. :ref:`String<class_String>` **get_terrain_name**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_terrain_name>`
  638. Returns a terrain's name.
  639. .. rst-class:: classref-item-separator
  640. ----
  641. .. _class_TileSet_method_get_terrain_set_mode:
  642. .. rst-class:: classref-method
  643. :ref:`TerrainMode<enum_TileSet_TerrainMode>` **get_terrain_set_mode**\ (\ terrain_set\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_terrain_set_mode>`
  644. Returns a terrain set mode.
  645. .. rst-class:: classref-item-separator
  646. ----
  647. .. _class_TileSet_method_get_terrain_sets_count:
  648. .. rst-class:: classref-method
  649. :ref:`int<class_int>` **get_terrain_sets_count**\ (\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_terrain_sets_count>`
  650. Returns the terrain sets count.
  651. .. rst-class:: classref-item-separator
  652. ----
  653. .. _class_TileSet_method_get_terrains_count:
  654. .. rst-class:: classref-method
  655. :ref:`int<class_int>` **get_terrains_count**\ (\ terrain_set\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_get_terrains_count>`
  656. Returns the number of terrains in the given terrain set.
  657. .. rst-class:: classref-item-separator
  658. ----
  659. .. _class_TileSet_method_has_alternative_level_tile_proxy:
  660. .. rst-class:: classref-method
  661. :ref:`bool<class_bool>` **has_alternative_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_has_alternative_level_tile_proxy>`
  662. Returns if there is an alternative-level proxy for the given identifiers.
  663. .. rst-class:: classref-item-separator
  664. ----
  665. .. _class_TileSet_method_has_coords_level_tile_proxy:
  666. .. rst-class:: classref-method
  667. :ref:`bool<class_bool>` **has_coords_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_has_coords_level_tile_proxy>`
  668. Returns if there is a coodinates-level proxy for the given identifiers.
  669. .. rst-class:: classref-item-separator
  670. ----
  671. .. _class_TileSet_method_has_custom_data_layer_by_name:
  672. .. rst-class:: classref-method
  673. :ref:`bool<class_bool>` **has_custom_data_layer_by_name**\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_has_custom_data_layer_by_name>`
  674. Returns if there is a custom data layer named ``layer_name``.
  675. .. rst-class:: classref-item-separator
  676. ----
  677. .. _class_TileSet_method_has_source:
  678. .. rst-class:: classref-method
  679. :ref:`bool<class_bool>` **has_source**\ (\ source_id\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_has_source>`
  680. Returns if this TileSet has a source for the given source ID.
  681. .. rst-class:: classref-item-separator
  682. ----
  683. .. _class_TileSet_method_has_source_level_tile_proxy:
  684. .. rst-class:: classref-method
  685. :ref:`bool<class_bool>` **has_source_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_has_source_level_tile_proxy>`
  686. Returns if there is a source-level proxy for the given source ID.
  687. .. rst-class:: classref-item-separator
  688. ----
  689. .. _class_TileSet_method_map_tile_proxy:
  690. .. rst-class:: classref-method
  691. :ref:`Array<class_Array>` **map_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TileSet_method_map_tile_proxy>`
  692. According to the configured proxies, maps the provided identifiers to a new set of identifiers. The source ID, atlas coordinates ID and alternative tile ID are returned as a 3 elements Array.
  693. This function first look for matching alternative-level proxies, then coordinates-level proxies, then source-level proxies.
  694. If no proxy corresponding to provided identifiers are found, returns the same values the ones used as arguments.
  695. .. rst-class:: classref-item-separator
  696. ----
  697. .. _class_TileSet_method_move_custom_data_layer:
  698. .. rst-class:: classref-method
  699. |void| **move_custom_data_layer**\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_move_custom_data_layer>`
  700. Moves the custom data layer at index ``layer_index`` to the given position ``to_position`` in the array. Also updates the atlas tiles accordingly.
  701. .. rst-class:: classref-item-separator
  702. ----
  703. .. _class_TileSet_method_move_navigation_layer:
  704. .. rst-class:: classref-method
  705. |void| **move_navigation_layer**\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_move_navigation_layer>`
  706. Moves the navigation layer at index ``layer_index`` to the given position ``to_position`` in the array. Also updates the atlas tiles accordingly.
  707. .. rst-class:: classref-item-separator
  708. ----
  709. .. _class_TileSet_method_move_occlusion_layer:
  710. .. rst-class:: classref-method
  711. |void| **move_occlusion_layer**\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_move_occlusion_layer>`
  712. Moves the occlusion layer at index ``layer_index`` to the given position ``to_position`` in the array. Also updates the atlas tiles accordingly.
  713. .. rst-class:: classref-item-separator
  714. ----
  715. .. _class_TileSet_method_move_physics_layer:
  716. .. rst-class:: classref-method
  717. |void| **move_physics_layer**\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_move_physics_layer>`
  718. Moves the physics layer at index ``layer_index`` to the given position ``to_position`` in the array. Also updates the atlas tiles accordingly.
  719. .. rst-class:: classref-item-separator
  720. ----
  721. .. _class_TileSet_method_move_terrain:
  722. .. rst-class:: classref-method
  723. |void| **move_terrain**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_move_terrain>`
  724. Moves the terrain at index ``terrain_index`` for terrain set ``terrain_set`` to the given position ``to_position`` in the array. Also updates the atlas tiles accordingly.
  725. .. rst-class:: classref-item-separator
  726. ----
  727. .. _class_TileSet_method_move_terrain_set:
  728. .. rst-class:: classref-method
  729. |void| **move_terrain_set**\ (\ terrain_set\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_move_terrain_set>`
  730. Moves the terrain set at index ``terrain_set`` to the given position ``to_position`` in the array. Also updates the atlas tiles accordingly.
  731. .. rst-class:: classref-item-separator
  732. ----
  733. .. _class_TileSet_method_remove_alternative_level_tile_proxy:
  734. .. rst-class:: classref-method
  735. |void| **remove_alternative_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_alternative_level_tile_proxy>`
  736. Removes an alternative-level proxy for the given identifiers.
  737. .. rst-class:: classref-item-separator
  738. ----
  739. .. _class_TileSet_method_remove_coords_level_tile_proxy:
  740. .. rst-class:: classref-method
  741. |void| **remove_coords_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_coords_level_tile_proxy>`
  742. Removes a coordinates-level proxy for the given identifiers.
  743. .. rst-class:: classref-item-separator
  744. ----
  745. .. _class_TileSet_method_remove_custom_data_layer:
  746. .. rst-class:: classref-method
  747. |void| **remove_custom_data_layer**\ (\ layer_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_custom_data_layer>`
  748. Removes the custom data layer at index ``layer_index``. Also updates the atlas tiles accordingly.
  749. .. rst-class:: classref-item-separator
  750. ----
  751. .. _class_TileSet_method_remove_navigation_layer:
  752. .. rst-class:: classref-method
  753. |void| **remove_navigation_layer**\ (\ layer_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_navigation_layer>`
  754. Removes the navigation layer at index ``layer_index``. Also updates the atlas tiles accordingly.
  755. .. rst-class:: classref-item-separator
  756. ----
  757. .. _class_TileSet_method_remove_occlusion_layer:
  758. .. rst-class:: classref-method
  759. |void| **remove_occlusion_layer**\ (\ layer_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_occlusion_layer>`
  760. Removes the occlusion layer at index ``layer_index``. Also updates the atlas tiles accordingly.
  761. .. rst-class:: classref-item-separator
  762. ----
  763. .. _class_TileSet_method_remove_pattern:
  764. .. rst-class:: classref-method
  765. |void| **remove_pattern**\ (\ index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_pattern>`
  766. Remove the :ref:`TileMapPattern<class_TileMapPattern>` at the given index.
  767. .. rst-class:: classref-item-separator
  768. ----
  769. .. _class_TileSet_method_remove_physics_layer:
  770. .. rst-class:: classref-method
  771. |void| **remove_physics_layer**\ (\ layer_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_physics_layer>`
  772. Removes the physics layer at index ``layer_index``. Also updates the atlas tiles accordingly.
  773. .. rst-class:: classref-item-separator
  774. ----
  775. .. _class_TileSet_method_remove_source:
  776. .. rst-class:: classref-method
  777. |void| **remove_source**\ (\ source_id\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_source>`
  778. Removes the source with the given source ID.
  779. .. rst-class:: classref-item-separator
  780. ----
  781. .. _class_TileSet_method_remove_source_level_tile_proxy:
  782. .. rst-class:: classref-method
  783. |void| **remove_source_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_source_level_tile_proxy>`
  784. Removes a source-level tile proxy.
  785. .. rst-class:: classref-item-separator
  786. ----
  787. .. _class_TileSet_method_remove_terrain:
  788. .. rst-class:: classref-method
  789. |void| **remove_terrain**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_terrain>`
  790. Removes the terrain at index ``terrain_index`` in the given terrain set ``terrain_set``. Also updates the atlas tiles accordingly.
  791. .. rst-class:: classref-item-separator
  792. ----
  793. .. _class_TileSet_method_remove_terrain_set:
  794. .. rst-class:: classref-method
  795. |void| **remove_terrain_set**\ (\ terrain_set\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_remove_terrain_set>`
  796. Removes the terrain set at index ``terrain_set``. Also updates the atlas tiles accordingly.
  797. .. rst-class:: classref-item-separator
  798. ----
  799. .. _class_TileSet_method_set_alternative_level_tile_proxy:
  800. .. rst-class:: classref-method
  801. |void| **set_alternative_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`, source_to\: :ref:`int<class_int>`, coords_to\: :ref:`Vector2i<class_Vector2i>`, alternative_to\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_alternative_level_tile_proxy>`
  802. Create an alternative-level proxy for the given identifiers. A proxy will map set of tile identifiers to another set of identifiers.
  803. This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target tile when one is available.
  804. Proxied tiles can be automatically replaced in TileMap nodes using the editor.
  805. .. rst-class:: classref-item-separator
  806. ----
  807. .. _class_TileSet_method_set_coords_level_tile_proxy:
  808. .. rst-class:: classref-method
  809. |void| **set_coords_level_tile_proxy**\ (\ p_source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, source_to\: :ref:`int<class_int>`, coords_to\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_coords_level_tile_proxy>`
  810. Creates a coordinates-level proxy for the given identifiers. A proxy will map set of tile identifiers to another set of identifiers. The alternative tile ID is kept the same when using coordinates-level proxies.
  811. This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target tile when one is available.
  812. Proxied tiles can be automatically replaced in TileMap nodes using the editor.
  813. .. rst-class:: classref-item-separator
  814. ----
  815. .. _class_TileSet_method_set_custom_data_layer_name:
  816. .. rst-class:: classref-method
  817. |void| **set_custom_data_layer_name**\ (\ layer_index\: :ref:`int<class_int>`, layer_name\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_custom_data_layer_name>`
  818. Sets the name of the custom data layer identified by the given index. Names are identifiers of the layer therefore if the name is already taken it will fail and raise an error.
  819. .. rst-class:: classref-item-separator
  820. ----
  821. .. _class_TileSet_method_set_custom_data_layer_type:
  822. .. rst-class:: classref-method
  823. |void| **set_custom_data_layer_type**\ (\ layer_index\: :ref:`int<class_int>`, layer_type\: :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_custom_data_layer_type>`
  824. Sets the type of the custom data layer identified by the given index.
  825. .. rst-class:: classref-item-separator
  826. ----
  827. .. _class_TileSet_method_set_navigation_layer_layer_value:
  828. .. rst-class:: classref-method
  829. |void| **set_navigation_layer_layer_value**\ (\ layer_index\: :ref:`int<class_int>`, layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_navigation_layer_layer_value>`
  830. Based on ``value``, enables or disables the specified navigation layer of the TileSet navigation data layer identified by the given ``layer_index``, given a navigation_layers ``layer_number`` between 1 and 32.
  831. .. rst-class:: classref-item-separator
  832. ----
  833. .. _class_TileSet_method_set_navigation_layer_layers:
  834. .. rst-class:: classref-method
  835. |void| **set_navigation_layer_layers**\ (\ layer_index\: :ref:`int<class_int>`, layers\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_navigation_layer_layers>`
  836. Sets the navigation layers (as in the navigation server) for navigation regions in the given TileSet navigation layer.
  837. .. rst-class:: classref-item-separator
  838. ----
  839. .. _class_TileSet_method_set_occlusion_layer_light_mask:
  840. .. rst-class:: classref-method
  841. |void| **set_occlusion_layer_light_mask**\ (\ layer_index\: :ref:`int<class_int>`, light_mask\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_occlusion_layer_light_mask>`
  842. Sets the occlusion layer (as in the rendering server) for occluders in the given TileSet occlusion layer.
  843. .. rst-class:: classref-item-separator
  844. ----
  845. .. _class_TileSet_method_set_occlusion_layer_sdf_collision:
  846. .. rst-class:: classref-method
  847. |void| **set_occlusion_layer_sdf_collision**\ (\ layer_index\: :ref:`int<class_int>`, sdf_collision\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_occlusion_layer_sdf_collision>`
  848. Enables or disables SDF collision for occluders in the given TileSet occlusion layer.
  849. .. rst-class:: classref-item-separator
  850. ----
  851. .. _class_TileSet_method_set_physics_layer_collision_layer:
  852. .. rst-class:: classref-method
  853. |void| **set_physics_layer_collision_layer**\ (\ layer_index\: :ref:`int<class_int>`, layer\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_physics_layer_collision_layer>`
  854. Sets the collision layer (as in the physics server) for bodies in the given TileSet physics layer.
  855. .. rst-class:: classref-item-separator
  856. ----
  857. .. _class_TileSet_method_set_physics_layer_collision_mask:
  858. .. rst-class:: classref-method
  859. |void| **set_physics_layer_collision_mask**\ (\ layer_index\: :ref:`int<class_int>`, mask\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_physics_layer_collision_mask>`
  860. Sets the collision mask for bodies in the given TileSet physics layer.
  861. .. rst-class:: classref-item-separator
  862. ----
  863. .. _class_TileSet_method_set_physics_layer_collision_priority:
  864. .. rst-class:: classref-method
  865. |void| **set_physics_layer_collision_priority**\ (\ layer_index\: :ref:`int<class_int>`, priority\: :ref:`float<class_float>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_physics_layer_collision_priority>`
  866. Sets the collision priority for bodies in the given TileSet physics layer.
  867. .. rst-class:: classref-item-separator
  868. ----
  869. .. _class_TileSet_method_set_physics_layer_physics_material:
  870. .. rst-class:: classref-method
  871. |void| **set_physics_layer_physics_material**\ (\ layer_index\: :ref:`int<class_int>`, physics_material\: :ref:`PhysicsMaterial<class_PhysicsMaterial>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_physics_layer_physics_material>`
  872. Sets the physics material for bodies in the given TileSet physics layer.
  873. .. rst-class:: classref-item-separator
  874. ----
  875. .. _class_TileSet_method_set_source_id:
  876. .. rst-class:: classref-method
  877. |void| **set_source_id**\ (\ source_id\: :ref:`int<class_int>`, new_source_id\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_source_id>`
  878. Changes a source's ID.
  879. .. rst-class:: classref-item-separator
  880. ----
  881. .. _class_TileSet_method_set_source_level_tile_proxy:
  882. .. rst-class:: classref-method
  883. |void| **set_source_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, source_to\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_source_level_tile_proxy>`
  884. Creates a source-level proxy for the given source ID. A proxy will map set of tile identifiers to another set of identifiers. Both the atlas coordinates ID and the alternative tile ID are kept the same when using source-level proxies.
  885. This can be used to replace a source in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target source when one is available.
  886. Proxied tiles can be automatically replaced in TileMap nodes using the editor.
  887. .. rst-class:: classref-item-separator
  888. ----
  889. .. _class_TileSet_method_set_terrain_color:
  890. .. rst-class:: classref-method
  891. |void| **set_terrain_color**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_terrain_color>`
  892. Sets a terrain's color. This color is used for identifying the different terrains in the TileSet editor.
  893. .. rst-class:: classref-item-separator
  894. ----
  895. .. _class_TileSet_method_set_terrain_name:
  896. .. rst-class:: classref-method
  897. |void| **set_terrain_name**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_terrain_name>`
  898. Sets a terrain's name.
  899. .. rst-class:: classref-item-separator
  900. ----
  901. .. _class_TileSet_method_set_terrain_set_mode:
  902. .. rst-class:: classref-method
  903. |void| **set_terrain_set_mode**\ (\ terrain_set\: :ref:`int<class_int>`, mode\: :ref:`TerrainMode<enum_TileSet_TerrainMode>`\ ) :ref:`๐Ÿ”—<class_TileSet_method_set_terrain_set_mode>`
  904. Sets a terrain mode. Each mode determines which bits of a tile shape is used to match the neighboring tiles' terrains.
  905. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  906. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  907. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  908. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  909. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  910. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  911. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  912. .. |void| replace:: :abbr:`void (No return value.)`