class_tileset.rst 100 KB

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