MeshLibrary.xml 5.7 KB

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