SpriteFrames.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="SpriteFrames" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. Sprite frame library for AnimatedSprite and AnimatedSprite3D.
  5. </brief_description>
  6. <description>
  7. Sprite frame library for an [AnimatedSprite] or [AnimatedSprite3D] node. Contains frames and animation data for playback.
  8. [b]Note:[/b] You can associate a set of normal maps by creating additional animations with a [code]_normal[/code] suffix. For example, having 2 animations [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. <argument index="0" name="anim" type="String" />
  16. <description>
  17. Adds a new animation to the library.
  18. </description>
  19. </method>
  20. <method name="add_frame">
  21. <return type="void" />
  22. <argument index="0" name="anim" type="String" />
  23. <argument index="1" name="frame" type="Texture" />
  24. <argument index="2" name="at_position" type="int" default="-1" />
  25. <description>
  26. Adds a frame to the given animation.
  27. </description>
  28. </method>
  29. <method name="clear">
  30. <return type="void" />
  31. <argument index="0" name="anim" type="String" />
  32. <description>
  33. Removes all frames from the given animation.
  34. </description>
  35. </method>
  36. <method name="clear_all">
  37. <return type="void" />
  38. <description>
  39. Removes all animations. A "default" animation will be created.
  40. </description>
  41. </method>
  42. <method name="get_animation_loop" qualifiers="const">
  43. <return type="bool" />
  44. <argument index="0" name="anim" type="String" />
  45. <description>
  46. Returns [code]true[/code] if the given animation is configured to loop when it finishes playing. Otherwise, returns [code]false[/code].
  47. </description>
  48. </method>
  49. <method name="get_animation_names" qualifiers="const">
  50. <return type="PoolStringArray" />
  51. <description>
  52. Returns an array containing the names associated to each animation. Values are placed in alphabetical order.
  53. </description>
  54. </method>
  55. <method name="get_animation_speed" qualifiers="const">
  56. <return type="float" />
  57. <argument index="0" name="anim" type="String" />
  58. <description>
  59. The animation's speed in frames per second.
  60. </description>
  61. </method>
  62. <method name="get_frame" qualifiers="const">
  63. <return type="Texture" />
  64. <argument index="0" name="anim" type="String" />
  65. <argument index="1" name="idx" type="int" />
  66. <description>
  67. Returns the animation's selected frame.
  68. </description>
  69. </method>
  70. <method name="get_frame_count" qualifiers="const">
  71. <return type="int" />
  72. <argument index="0" name="anim" type="String" />
  73. <description>
  74. Returns the number of frames in the animation.
  75. </description>
  76. </method>
  77. <method name="has_animation" qualifiers="const">
  78. <return type="bool" />
  79. <argument index="0" name="anim" type="String" />
  80. <description>
  81. If [code]true[/code], the named animation exists.
  82. </description>
  83. </method>
  84. <method name="remove_animation">
  85. <return type="void" />
  86. <argument index="0" name="anim" type="String" />
  87. <description>
  88. Removes the given animation.
  89. </description>
  90. </method>
  91. <method name="remove_frame">
  92. <return type="void" />
  93. <argument index="0" name="anim" type="String" />
  94. <argument index="1" name="idx" type="int" />
  95. <description>
  96. Removes the animation's selected frame.
  97. </description>
  98. </method>
  99. <method name="rename_animation">
  100. <return type="void" />
  101. <argument index="0" name="anim" type="String" />
  102. <argument index="1" name="newname" type="String" />
  103. <description>
  104. Changes the animation's name to [code]newname[/code].
  105. </description>
  106. </method>
  107. <method name="set_animation_loop">
  108. <return type="void" />
  109. <argument index="0" name="anim" type="String" />
  110. <argument index="1" name="loop" type="bool" />
  111. <description>
  112. If [code]true[/code], the animation will loop.
  113. </description>
  114. </method>
  115. <method name="set_animation_speed">
  116. <return type="void" />
  117. <argument index="0" name="anim" type="String" />
  118. <argument index="1" name="speed" type="float" />
  119. <description>
  120. The animation's speed in frames per second.
  121. </description>
  122. </method>
  123. <method name="set_frame">
  124. <return type="void" />
  125. <argument index="0" name="anim" type="String" />
  126. <argument index="1" name="idx" type="int" />
  127. <argument index="2" name="txt" type="Texture" />
  128. <description>
  129. Sets the texture of the given frame.
  130. </description>
  131. </method>
  132. </methods>
  133. <members>
  134. <member name="frames" type="Array" setter="_set_frames" getter="_get_frames">
  135. Compatibility property, always equals to an empty array.
  136. </member>
  137. </members>
  138. <constants>
  139. </constants>
  140. </class>