AnimatedSprite.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AnimatedSprite" inherits="Node2D" category="Core" version="3.2">
  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. <methods>
  12. <method name="is_playing" qualifiers="const">
  13. <return type="bool">
  14. </return>
  15. <description>
  16. Returns [code]true[/code] if an animation if currently being played.
  17. </description>
  18. </method>
  19. <method name="play">
  20. <return type="void">
  21. </return>
  22. <argument index="0" name="anim" type="String" default="&quot;&quot;">
  23. </argument>
  24. <argument index="1" name="backwards" type="bool" default="false">
  25. </argument>
  26. <description>
  27. Play the animation set in parameter. If no parameter is provided, the current animation is played. Property [code]backwards[/code] plays the animation in reverse if set to [code]true[/code].
  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. The animation speed is multiplied by this value.
  65. </member>
  66. </members>
  67. <signals>
  68. <signal name="animation_finished">
  69. <description>
  70. 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.
  71. </description>
  72. </signal>
  73. <signal name="frame_changed">
  74. <description>
  75. Emitted when [member frame] changed.
  76. </description>
  77. </signal>
  78. </signals>
  79. <constants>
  80. </constants>
  81. </class>