class_animatedsprite.rst 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_AnimatedSprite:
  4. AnimatedSprite
  5. ==============
  6. **Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Sprite node that can use multiple textures for animation.
  11. Member Functions
  12. ----------------
  13. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`set_sprite_frames<class_AnimatedSprite_set_sprite_frames>` **(** :ref:`SpriteFrames<class_spriteframes>` sprite_frames **)** |
  15. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`SpriteFrames<class_spriteframes>` | :ref:`get_sprite_frames<class_AnimatedSprite_get_sprite_frames>` **(** **)** const |
  17. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`set_centered<class_AnimatedSprite_set_centered>` **(** :ref:`bool<class_bool>` centered **)** |
  19. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`bool<class_bool>` | :ref:`is_centered<class_AnimatedSprite_is_centered>` **(** **)** const |
  21. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`set_offset<class_AnimatedSprite_set_offset>` **(** :ref:`Vector2<class_vector2>` offset **)** |
  23. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Vector2<class_vector2>` | :ref:`get_offset<class_AnimatedSprite_get_offset>` **(** **)** const |
  25. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`set_flip_h<class_AnimatedSprite_set_flip_h>` **(** :ref:`bool<class_bool>` flip_h **)** |
  27. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`is_flipped_h<class_AnimatedSprite_is_flipped_h>` **(** **)** const |
  29. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`set_flip_v<class_AnimatedSprite_set_flip_v>` **(** :ref:`bool<class_bool>` flip_v **)** |
  31. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`is_flipped_v<class_AnimatedSprite_is_flipped_v>` **(** **)** const |
  33. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_frame<class_AnimatedSprite_set_frame>` **(** :ref:`int<class_int>` frame **)** |
  35. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`get_frame<class_AnimatedSprite_get_frame>` **(** **)** const |
  37. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_modulate<class_AnimatedSprite_set_modulate>` **(** :ref:`Color<class_color>` modulate **)** |
  39. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`Color<class_color>` | :ref:`get_modulate<class_AnimatedSprite_get_modulate>` **(** **)** const |
  41. +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  42. Signals
  43. -------
  44. - **frame_changed** **(** **)**
  45. Description
  46. -----------
  47. Sprite node that can use multiple textures for animation.
  48. Member Function Description
  49. ---------------------------
  50. .. _class_AnimatedSprite_set_sprite_frames:
  51. - void **set_sprite_frames** **(** :ref:`SpriteFrames<class_spriteframes>` sprite_frames **)**
  52. Set the :ref:`SpriteFrames<class_spriteframes>` resource, which contains all frames.
  53. .. _class_AnimatedSprite_get_sprite_frames:
  54. - :ref:`SpriteFrames<class_spriteframes>` **get_sprite_frames** **(** **)** const
  55. Get the :ref:`SpriteFrames<class_spriteframes>` resource, which contains all frames.
  56. .. _class_AnimatedSprite_set_centered:
  57. - void **set_centered** **(** :ref:`bool<class_bool>` centered **)**
  58. When turned on, offset at (0,0) is the center of the sprite, when off, the top-left corner is.
  59. .. _class_AnimatedSprite_is_centered:
  60. - :ref:`bool<class_bool>` **is_centered** **(** **)** const
  61. Return true when centered. See :ref:`set_centered<class_AnimatedSprite_set_centered>`.
  62. .. _class_AnimatedSprite_set_offset:
  63. - void **set_offset** **(** :ref:`Vector2<class_vector2>` offset **)**
  64. Set the offset of the sprite in the node origin. Position varies depending on whether it is centered or not.
  65. .. _class_AnimatedSprite_get_offset:
  66. - :ref:`Vector2<class_vector2>` **get_offset** **(** **)** const
  67. Return the offset of the sprite in the node origin.
  68. .. _class_AnimatedSprite_set_flip_h:
  69. - void **set_flip_h** **(** :ref:`bool<class_bool>` flip_h **)**
  70. If true, sprite is flipped horizontally.
  71. .. _class_AnimatedSprite_is_flipped_h:
  72. - :ref:`bool<class_bool>` **is_flipped_h** **(** **)** const
  73. Return true if sprite is flipped horizontally.
  74. .. _class_AnimatedSprite_set_flip_v:
  75. - void **set_flip_v** **(** :ref:`bool<class_bool>` flip_v **)**
  76. If true, sprite is flipped vertically.
  77. .. _class_AnimatedSprite_is_flipped_v:
  78. - :ref:`bool<class_bool>` **is_flipped_v** **(** **)** const
  79. Return true if sprite is flipped vertically.
  80. .. _class_AnimatedSprite_set_frame:
  81. - void **set_frame** **(** :ref:`int<class_int>` frame **)**
  82. Set the visible sprite frame index (from the list of frames inside the :ref:`SpriteFrames<class_spriteframes>` resource).
  83. .. _class_AnimatedSprite_get_frame:
  84. - :ref:`int<class_int>` **get_frame** **(** **)** const
  85. Return the visible frame index.
  86. .. _class_AnimatedSprite_set_modulate:
  87. - void **set_modulate** **(** :ref:`Color<class_color>` modulate **)**
  88. Change the color modulation (multiplication) for this sprite.
  89. .. _class_AnimatedSprite_get_modulate:
  90. - :ref:`Color<class_color>` **get_modulate** **(** **)** const
  91. Return the color modulation for this sprite.