class_animatedsprite3d.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. .. _class_AnimatedSprite3D_frame_changed:
  36. - **frame_changed** **(** **)**
  37. Emitted when :ref:`frame<class_AnimatedSprite3D_frame>` changed.
  38. Member Variables
  39. ----------------
  40. .. _class_AnimatedSprite3D_animation:
  41. - :ref:`String<class_string>` **animation** - The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset.
  42. .. _class_AnimatedSprite3D_frame:
  43. - :ref:`int<class_int>` **frame** - The displayed animation frame's index.
  44. .. _class_AnimatedSprite3D_frames:
  45. - :ref:`SpriteFrames<class_spriteframes>` **frames** - The :ref:`SpriteFrames<class_spriteframes>` resource containing the animation(s).
  46. .. _class_AnimatedSprite3D_playing:
  47. - :ref:`bool<class_bool>` **playing** - If ``true`` the :ref:`animation<class_AnimatedSprite3D_animation>` is currently playing.
  48. Description
  49. -----------
  50. Animations are created using a :ref:`SpriteFrames<class_spriteframes>` resource, which can be configured in the editor via the SpriteFrames panel.
  51. Member Function Description
  52. ---------------------------
  53. .. _class_AnimatedSprite3D_get_animation:
  54. - :ref:`String<class_string>` **get_animation** **(** **)** const
  55. Return the name of the current animation set to the node.
  56. .. _class_AnimatedSprite3D_get_frame:
  57. - :ref:`int<class_int>` **get_frame** **(** **)** const
  58. Return the visible frame index.
  59. .. _class_AnimatedSprite3D_get_sprite_frames:
  60. - :ref:`SpriteFrames<class_spriteframes>` **get_sprite_frames** **(** **)** const
  61. Get the :ref:`SpriteFrames<class_spriteframes>` resource, which contains all frames.
  62. .. _class_AnimatedSprite3D_is_playing:
  63. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  64. Return true if an animation if currently being played.
  65. .. _class_AnimatedSprite3D_play:
  66. - void **play** **(** :ref:`String<class_string>` anim="" **)**
  67. Play the animation set in parameter. If no parameter is provided, the current animation is played.
  68. .. _class_AnimatedSprite3D_set_animation:
  69. - void **set_animation** **(** :ref:`String<class_string>` animation **)**
  70. Set the current animation of the node and reinits the frame counter of the animation.
  71. .. _class_AnimatedSprite3D_set_frame:
  72. - void **set_frame** **(** :ref:`int<class_int>` frame **)**
  73. Set the visible sprite frame index (from the list of frames inside the :ref:`SpriteFrames<class_spriteframes>` resource).
  74. .. _class_AnimatedSprite3D_set_sprite_frames:
  75. - void **set_sprite_frames** **(** :ref:`SpriteFrames<class_spriteframes>` sprite_frames **)**
  76. Set the :ref:`SpriteFrames<class_spriteframes>` resource, which contains all frames.
  77. .. _class_AnimatedSprite3D_stop:
  78. - void **stop** **(** **)**
  79. Stop the current animation (does not reset the frame counter).