AnimatedSprite3D.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AnimatedSprite3D" inherits="SpriteBase3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. 2D sprite node in 3D world, that can use multiple 2D 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. <link title="2D Sprite animation (also applies to 3D)">$DOCS_URL/tutorials/2d/2d_sprite_animation.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="is_playing" qualifiers="const">
  14. <return type="bool" />
  15. <description>
  16. Returns [code]true[/code] if an animation is currently being played.
  17. </description>
  18. </method>
  19. <method name="play">
  20. <return type="void" />
  21. <argument index="0" name="anim" type="String" default="&quot;&quot;" />
  22. <description>
  23. Plays the animation named [code]anim[/code]. If no [code]anim[/code] is provided, the current animation is played.
  24. </description>
  25. </method>
  26. <method name="stop">
  27. <return type="void" />
  28. <description>
  29. Stops the current animation (does not reset the frame counter).
  30. </description>
  31. </method>
  32. </methods>
  33. <members>
  34. <member name="animation" type="String" setter="set_animation" getter="get_animation" default="&quot;default&quot;">
  35. The current animation from the [code]frames[/code] resource. If this value changes, the [code]frame[/code] counter is reset.
  36. </member>
  37. <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0">
  38. The displayed animation frame's index.
  39. </member>
  40. <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames">
  41. The [SpriteFrames] resource containing the animation(s).
  42. </member>
  43. <member name="playing" type="bool" setter="_set_playing" getter="_is_playing" default="false">
  44. If [code]true[/code], the [member animation] is currently playing.
  45. </member>
  46. </members>
  47. <signals>
  48. <signal name="animation_finished">
  49. <description>
  50. 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.
  51. </description>
  52. </signal>
  53. <signal name="frame_changed">
  54. <description>
  55. Emitted when [member frame] changed.
  56. </description>
  57. </signal>
  58. </signals>
  59. <constants>
  60. </constants>
  61. </class>