AnimatedSprite¶
Inherits: Node2D < CanvasItem < Node < Object
Nodo Sprite que puede usar múltiples texturas para la animación.
Descripción¶
Animations are created using a SpriteFrames resource, which can be configured in the editor via the SpriteFrames panel.
Note: You can associate a set of normal maps by creating additional SpriteFrames resources with a _normal
suffix. For example, having 2 SpriteFrames resources run
and run_normal
will make it so the run
animation uses the normal map.
Tutoriales¶
Propiedades¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Métodos¶
void |
|
void |
stop ( ) |
Señales¶
animation_finished ( )
Se emite cuando la animación termina (cuando reproduce el último fotograma). Si la animación está en bucle, esta señal se emite cada vez que se reproduce el último fotograma.
frame_changed ( )
Emitido cuando frame cambió.
Descripciones de Propiedades¶
String animation
Default |
|
Setter |
set_animation(value) |
Getter |
get_animation() |
La animación actual del recurso frames
. Si este valor cambia, el contador frame
se reinicia.
bool centered
Default |
|
Setter |
set_centered(value) |
Getter |
is_centered() |
Si true
, la textura se centrará.
bool flip_h
Default |
|
Setter |
set_flip_h(value) |
Getter |
is_flipped_h() |
Si true
, la textura se voltea horizontalmente.
bool flip_v
Default |
|
Setter |
set_flip_v(value) |
Getter |
is_flipped_v() |
Si true
, la textura se voltea verticalmente.
int frame
Default |
|
Setter |
set_frame(value) |
Getter |
get_frame() |
El índice del cuadro de animación mostrado.
SpriteFrames frames
Setter |
set_sprite_frames(value) |
Getter |
get_sprite_frames() |
El recurso SpriteFrames que contiene la(s) animación(es).
Vector2 offset
Default |
|
Setter |
set_offset(value) |
Getter |
get_offset() |
El desplazamiento al dibujar de la textura.
bool playing
Default |
|
Setter |
set_playing(value) |
Getter |
is_playing() |
Si true
, la animation se está reproduciendo actualmente.
float speed_scale
Default |
|
Setter |
set_speed_scale(value) |
Getter |
get_speed_scale() |
La velocidad de la animación se multiplica por este valor.
Descripciones de Métodos¶
Reproduce la animación llamada anim
. Si no se proporciona anim
, se reproduce la animación actual. Si backwards
es true
, la animación se reproduce al revés.
void stop ( )
Detiene la animación actual (no reinicia el contador de fotogramas).