class_tileset.rst 74 KB

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