class_tileset.rst 102 KB

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