AnimatedSprite.xml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AnimatedSprite" inherits="Node2D" category="Core" version="3.1">
  3. <brief_description>
  4. Sprite node that can use multiple textures for animation.
  5. </brief_description>
  6. <description>
  7. Animations are created using a [SpriteFrames] resource, which can be configured in the editor via the SpriteFrames panel.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="is_playing" qualifiers="const">
  15. <return type="bool">
  16. </return>
  17. <description>
  18. Return true if an animation if currently being played.
  19. </description>
  20. </method>
  21. <method name="play">
  22. <return type="void">
  23. </return>
  24. <argument index="0" name="anim" type="String" default="&quot;&quot;">
  25. </argument>
  26. <description>
  27. Play the animation set in parameter. If no parameter is provided, the current animation is played.
  28. </description>
  29. </method>
  30. <method name="stop">
  31. <return type="void">
  32. </return>
  33. <description>
  34. Stop the current animation (does not reset the frame counter).
  35. </description>
  36. </method>
  37. </methods>
  38. <members>
  39. <member name="animation" type="String" setter="set_animation" getter="get_animation">
  40. The current animation from the [code]frames[/code] resource. If this value changes, the [code]frame[/code] counter is reset.
  41. </member>
  42. <member name="centered" type="bool" setter="set_centered" getter="is_centered">
  43. If [code]true[/code], texture will be centered. Default value: [code]true[/code].
  44. </member>
  45. <member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h">
  46. If [code]true[/code], texture is flipped horizontally. Default value: [code]false[/code].
  47. </member>
  48. <member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v">
  49. If [code]true[/code], texture is flipped vertically. Default value: [code]false[/code].
  50. </member>
  51. <member name="frame" type="int" setter="set_frame" getter="get_frame">
  52. The displayed animation frame's index.
  53. </member>
  54. <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames">
  55. The [SpriteFrames] resource containing the animation(s).
  56. </member>
  57. <member name="offset" type="Vector2" setter="set_offset" getter="get_offset">
  58. The texture's drawing offset.
  59. </member>
  60. <member name="playing" type="bool" setter="_set_playing" getter="_is_playing">
  61. If [code]true[/code], the [member animation] is currently playing.
  62. </member>
  63. <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale">
  64. </member>
  65. </members>
  66. <signals>
  67. <signal name="animation_finished">
  68. <description>
  69. Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn.
  70. </description>
  71. </signal>
  72. <signal name="frame_changed">
  73. <description>
  74. Emitted when [member frame] changed.
  75. </description>
  76. </signal>
  77. </signals>
  78. <constants>
  79. </constants>
  80. </class>