SpriteFrames.xml 4.8 KB

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