SpriteFrames.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="SpriteFrames" inherits="Resource" version="3.4">
  3. <brief_description>
  4. Sprite frame library for AnimatedSprite.
  5. </brief_description>
  6. <description>
  7. Sprite frame library for [AnimatedSprite]. Contains frames and animation data for playback.
  8. [b]Note:[/b] You can associate a set of normal maps by creating additional [SpriteFrames] resources with a [code]_normal[/code] suffix. For example, having 2 [SpriteFrames] resources [code]run[/code] and [code]run_normal[/code] will make it so the [code]run[/code] animation uses the normal map.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="add_animation">
  14. <return type="void">
  15. </return>
  16. <argument index="0" name="anim" type="String">
  17. </argument>
  18. <description>
  19. Adds a new animation to the library.
  20. </description>
  21. </method>
  22. <method name="add_frame">
  23. <return type="void">
  24. </return>
  25. <argument index="0" name="anim" type="String">
  26. </argument>
  27. <argument index="1" name="frame" type="Texture">
  28. </argument>
  29. <argument index="2" name="at_position" type="int" default="-1">
  30. </argument>
  31. <description>
  32. Adds a frame to the given animation.
  33. </description>
  34. </method>
  35. <method name="clear">
  36. <return type="void">
  37. </return>
  38. <argument index="0" name="anim" type="String">
  39. </argument>
  40. <description>
  41. Removes all frames from the given animation.
  42. </description>
  43. </method>
  44. <method name="clear_all">
  45. <return type="void">
  46. </return>
  47. <description>
  48. Removes all animations. A "default" animation will be created.
  49. </description>
  50. </method>
  51. <method name="get_animation_loop" qualifiers="const">
  52. <return type="bool">
  53. </return>
  54. <argument index="0" name="anim" type="String">
  55. </argument>
  56. <description>
  57. Returns [code]true[/code] if the given animation is configured to loop when it finishes playing. Otherwise, returns [code]false[/code].
  58. </description>
  59. </method>
  60. <method name="get_animation_names" qualifiers="const">
  61. <return type="PoolStringArray">
  62. </return>
  63. <description>
  64. Returns an array containing the names associated to each animation. Values are placed in alphabetical order.
  65. </description>
  66. </method>
  67. <method name="get_animation_speed" qualifiers="const">
  68. <return type="float">
  69. </return>
  70. <argument index="0" name="anim" type="String">
  71. </argument>
  72. <description>
  73. The animation's speed in frames per second.
  74. </description>
  75. </method>
  76. <method name="get_frame" qualifiers="const">
  77. <return type="Texture">
  78. </return>
  79. <argument index="0" name="anim" type="String">
  80. </argument>
  81. <argument index="1" name="idx" type="int">
  82. </argument>
  83. <description>
  84. Returns the animation's selected frame.
  85. </description>
  86. </method>
  87. <method name="get_frame_count" qualifiers="const">
  88. <return type="int">
  89. </return>
  90. <argument index="0" name="anim" type="String">
  91. </argument>
  92. <description>
  93. Returns the number of frames in the animation.
  94. </description>
  95. </method>
  96. <method name="has_animation" qualifiers="const">
  97. <return type="bool">
  98. </return>
  99. <argument index="0" name="anim" type="String">
  100. </argument>
  101. <description>
  102. If [code]true[/code], the named animation exists.
  103. </description>
  104. </method>
  105. <method name="remove_animation">
  106. <return type="void">
  107. </return>
  108. <argument index="0" name="anim" type="String">
  109. </argument>
  110. <description>
  111. Removes the given animation.
  112. </description>
  113. </method>
  114. <method name="remove_frame">
  115. <return type="void">
  116. </return>
  117. <argument index="0" name="anim" type="String">
  118. </argument>
  119. <argument index="1" name="idx" type="int">
  120. </argument>
  121. <description>
  122. Removes the animation's selected frame.
  123. </description>
  124. </method>
  125. <method name="rename_animation">
  126. <return type="void">
  127. </return>
  128. <argument index="0" name="anim" type="String">
  129. </argument>
  130. <argument index="1" name="newname" type="String">
  131. </argument>
  132. <description>
  133. Changes the animation's name to [code]newname[/code].
  134. </description>
  135. </method>
  136. <method name="set_animation_loop">
  137. <return type="void">
  138. </return>
  139. <argument index="0" name="anim" type="String">
  140. </argument>
  141. <argument index="1" name="loop" type="bool">
  142. </argument>
  143. <description>
  144. If [code]true[/code], the animation will loop.
  145. </description>
  146. </method>
  147. <method name="set_animation_speed">
  148. <return type="void">
  149. </return>
  150. <argument index="0" name="anim" type="String">
  151. </argument>
  152. <argument index="1" name="speed" type="float">
  153. </argument>
  154. <description>
  155. The animation's speed in frames per second.
  156. </description>
  157. </method>
  158. <method name="set_frame">
  159. <return type="void">
  160. </return>
  161. <argument index="0" name="anim" type="String">
  162. </argument>
  163. <argument index="1" name="idx" type="int">
  164. </argument>
  165. <argument index="2" name="txt" type="Texture">
  166. </argument>
  167. <description>
  168. Sets the texture of the given frame.
  169. </description>
  170. </method>
  171. </methods>
  172. <members>
  173. <member name="frames" type="Array" setter="_set_frames" getter="_get_frames">
  174. Compatibility property, always equals to an empty array.
  175. </member>
  176. </members>
  177. <constants>
  178. </constants>
  179. </class>