class_animatedsprite3d.rst 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the AnimatedSprite3D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_AnimatedSprite3D:
  5. AnimatedSprite3D
  6. ================
  7. **Inherits:** :ref:`SpriteBase3D<class_spritebase3d>` **<** :ref:`GeometryInstance<class_geometryinstance>` **<** :ref:`VisualInstance<class_visualinstance>` **<** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. 2D sprite node in 3D world, that can use multiple 2D textures for animation.
  12. Member Functions
  13. ----------------
  14. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`String<class_string>` | :ref:`get_animation<class_AnimatedSprite3D_get_animation>` **(** **)** const |
  16. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`get_frame<class_AnimatedSprite3D_get_frame>` **(** **)** const |
  18. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`SpriteFrames<class_spriteframes>` | :ref:`get_sprite_frames<class_AnimatedSprite3D_get_sprite_frames>` **(** **)** const |
  20. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite3D_is_playing>` **(** **)** const |
  22. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`play<class_AnimatedSprite3D_play>` **(** :ref:`String<class_string>` anim="" **)** |
  24. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`set_animation<class_AnimatedSprite3D_set_animation>` **(** :ref:`String<class_string>` animation **)** |
  26. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`set_frame<class_AnimatedSprite3D_set_frame>` **(** :ref:`int<class_int>` frame **)** |
  28. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`set_sprite_frames<class_AnimatedSprite3D_set_sprite_frames>` **(** :ref:`SpriteFrames<class_spriteframes>` sprite_frames **)** |
  30. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`stop<class_AnimatedSprite3D_stop>` **(** **)** |
  32. +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  33. Signals
  34. -------
  35. - **frame_changed** **(** **)**
  36. Emitted when member frame changed.
  37. Member Variables
  38. ----------------
  39. - :ref:`String<class_string>` **animation** - The current animation from the [code]frames[/code] resource. If this value changes, the [code]frame[/code] counter is reset.
  40. - :ref:`int<class_int>` **frame** - The displayed animation frame's index.
  41. - :ref:`SpriteFrames<class_spriteframes>` **frames** - The [SpriteFrames] resource containing the animation(s).
  42. - :ref:`bool<class_bool>` **playing** - If [code]true[/code] the [member animation] is currently playing.
  43. Description
  44. -----------
  45. Animations are created using a :ref:`SpriteFrames<class_spriteframes>` resource, which can be configured in the editor via the SpriteFrames panel.
  46. Member Function Description
  47. ---------------------------
  48. .. _class_AnimatedSprite3D_get_animation:
  49. - :ref:`String<class_string>` **get_animation** **(** **)** const
  50. Return the name of the current animation set to the node.
  51. .. _class_AnimatedSprite3D_get_frame:
  52. - :ref:`int<class_int>` **get_frame** **(** **)** const
  53. Return the visible frame index.
  54. .. _class_AnimatedSprite3D_get_sprite_frames:
  55. - :ref:`SpriteFrames<class_spriteframes>` **get_sprite_frames** **(** **)** const
  56. Get the :ref:`SpriteFrames<class_spriteframes>` resource, which contains all frames.
  57. .. _class_AnimatedSprite3D_is_playing:
  58. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  59. Return true if an animation if currently being played.
  60. .. _class_AnimatedSprite3D_play:
  61. - void **play** **(** :ref:`String<class_string>` anim="" **)**
  62. Play the animation set in parameter. If no parameter is provided, the current animation is played.
  63. .. _class_AnimatedSprite3D_set_animation:
  64. - void **set_animation** **(** :ref:`String<class_string>` animation **)**
  65. Set the current animation of the node and reinits the frame counter of the animation.
  66. .. _class_AnimatedSprite3D_set_frame:
  67. - void **set_frame** **(** :ref:`int<class_int>` frame **)**
  68. Set the visible sprite frame index (from the list of frames inside the :ref:`SpriteFrames<class_spriteframes>` resource).
  69. .. _class_AnimatedSprite3D_set_sprite_frames:
  70. - void **set_sprite_frames** **(** :ref:`SpriteFrames<class_spriteframes>` sprite_frames **)**
  71. Set the :ref:`SpriteFrames<class_spriteframes>` resource, which contains all frames.
  72. .. _class_AnimatedSprite3D_stop:
  73. - void **stop** **(** **)**
  74. Stop the current animation (does not reset the frame counter).