MeshLibrary.xml 5.6 KB

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