MeshLibrary.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="MeshLibrary" inherits="Resource" version="3.2">
  3. <brief_description>
  4. Library of meshes.
  5. </brief_description>
  6. <description>
  7. A library of meshes. Contains a list of [Mesh] resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in [GridMap].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="clear">
  13. <return type="void">
  14. </return>
  15. <description>
  16. Clears the library.
  17. </description>
  18. </method>
  19. <method name="create_item">
  20. <return type="void">
  21. </return>
  22. <argument index="0" name="id" type="int">
  23. </argument>
  24. <description>
  25. Creates a new item in the library with the given ID.
  26. You can get an unused ID from [method get_last_unused_item_id].
  27. </description>
  28. </method>
  29. <method name="find_item_by_name" qualifiers="const">
  30. <return type="int">
  31. </return>
  32. <argument index="0" name="name" type="String">
  33. </argument>
  34. <description>
  35. Returns the first item with the given name.
  36. </description>
  37. </method>
  38. <method name="get_item_list" qualifiers="const">
  39. <return type="PoolIntArray">
  40. </return>
  41. <description>
  42. Returns the list of item IDs in use.
  43. </description>
  44. </method>
  45. <method name="get_item_mesh" qualifiers="const">
  46. <return type="Mesh">
  47. </return>
  48. <argument index="0" name="id" type="int">
  49. </argument>
  50. <description>
  51. Returns the item's mesh.
  52. </description>
  53. </method>
  54. <method name="get_item_name" qualifiers="const">
  55. <return type="String">
  56. </return>
  57. <argument index="0" name="id" type="int">
  58. </argument>
  59. <description>
  60. Returns the item's name.
  61. </description>
  62. </method>
  63. <method name="get_item_navmesh" qualifiers="const">
  64. <return type="NavigationMesh">
  65. </return>
  66. <argument index="0" name="id" type="int">
  67. </argument>
  68. <description>
  69. Returns the item's navigation mesh.
  70. </description>
  71. </method>
  72. <method name="get_item_navmesh_transform" qualifiers="const">
  73. <return type="Transform">
  74. </return>
  75. <argument index="0" name="id" type="int">
  76. </argument>
  77. <description>
  78. Returns the transform applied to the item's navigation mesh.
  79. </description>
  80. </method>
  81. <method name="get_item_preview" qualifiers="const">
  82. <return type="Texture">
  83. </return>
  84. <argument index="0" name="id" type="int">
  85. </argument>
  86. <description>
  87. When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using [method set_item_preview]. Returns an empty [Texture] if no preview was manually set in a running project.
  88. </description>
  89. </method>
  90. <method name="get_item_shapes" qualifiers="const">
  91. <return type="Array">
  92. </return>
  93. <argument index="0" name="id" type="int">
  94. </argument>
  95. <description>
  96. Returns an item's collision shapes.
  97. The array consists of each [Shape] followed by its [Transform].
  98. </description>
  99. </method>
  100. <method name="get_last_unused_item_id" qualifiers="const">
  101. <return type="int">
  102. </return>
  103. <description>
  104. Gets an unused ID for a new item.
  105. </description>
  106. </method>
  107. <method name="remove_item">
  108. <return type="void">
  109. </return>
  110. <argument index="0" name="id" type="int">
  111. </argument>
  112. <description>
  113. Removes the item.
  114. </description>
  115. </method>
  116. <method name="set_item_mesh">
  117. <return type="void">
  118. </return>
  119. <argument index="0" name="id" type="int">
  120. </argument>
  121. <argument index="1" name="mesh" type="Mesh">
  122. </argument>
  123. <description>
  124. Sets the item's mesh.
  125. </description>
  126. </method>
  127. <method name="set_item_name">
  128. <return type="void">
  129. </return>
  130. <argument index="0" name="id" type="int">
  131. </argument>
  132. <argument index="1" name="name" type="String">
  133. </argument>
  134. <description>
  135. Sets the item's name.
  136. This name is shown in the editor. It can also be used to look up the item later using [method find_item_by_name].
  137. </description>
  138. </method>
  139. <method name="set_item_navmesh">
  140. <return type="void">
  141. </return>
  142. <argument index="0" name="id" type="int">
  143. </argument>
  144. <argument index="1" name="navmesh" type="NavigationMesh">
  145. </argument>
  146. <description>
  147. Sets the item's navigation mesh.
  148. </description>
  149. </method>
  150. <method name="set_item_navmesh_transform">
  151. <return type="void">
  152. </return>
  153. <argument index="0" name="id" type="int">
  154. </argument>
  155. <argument index="1" name="navmesh" type="Transform">
  156. </argument>
  157. <description>
  158. Sets the transform to apply to the item's navigation mesh.
  159. </description>
  160. </method>
  161. <method name="set_item_preview">
  162. <return type="void">
  163. </return>
  164. <argument index="0" name="id" type="int">
  165. </argument>
  166. <argument index="1" name="texture" type="Texture">
  167. </argument>
  168. <description>
  169. Sets a texture to use as the item's preview icon in the editor.
  170. </description>
  171. </method>
  172. <method name="set_item_shapes">
  173. <return type="void">
  174. </return>
  175. <argument index="0" name="id" type="int">
  176. </argument>
  177. <argument index="1" name="shapes" type="Array">
  178. </argument>
  179. <description>
  180. Sets an item's collision shapes.
  181. The array should consist of [Shape] objects, each followed by a [Transform] that will be applied to it. For shapes that should not have a transform, use [constant Transform.IDENTITY].
  182. </description>
  183. </method>
  184. </methods>
  185. <constants>
  186. </constants>
  187. </class>