SpriteFrames

Inherits: Resource < Reference < Object

Sprite frame library for AnimatedSprite.

Descripción

Sprite frame library for AnimatedSprite. Contains frames and animation data for playback.

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.

Propiedades

Array

frames

Métodos

void

add_animation ( String anim )

void

add_frame ( String anim, Texture frame, int at_position=-1 )

void

clear ( String anim )

void

clear_all ( )

bool

get_animation_loop ( String anim ) const

PoolStringArray

get_animation_names ( ) const

float

get_animation_speed ( String anim ) const

Texture

get_frame ( String anim, int idx ) const

int

get_frame_count ( String anim ) const

bool

has_animation ( String anim ) const

void

remove_animation ( String anim )

void

remove_frame ( String anim, int idx )

void

rename_animation ( String anim, String newname )

void

set_animation_loop ( String anim, bool loop )

void

set_animation_speed ( String anim, float speed )

void

set_frame ( String anim, int idx, Texture txt )

Descripciones de Propiedades

La propiedad de compatibilidad, siempre equivale a una array vacío.

Descripciones de Métodos

  • void add_animation ( String anim )

Añade una nueva animación a la biblioteca.


Añade un fotograma a la animación dada.


Elimina todos los fotogramas de la animación dada.


  • void clear_all ( )

Elimina todas las animaciones. Se creará una animación "por defecto".


Returns true if the given animation is configured to loop when it finishes playing. Otherwise, returns false.


Devuelve un array que contiene los nombres asociados a cada animación. Los valores se colocan en orden alfabético.


La velocidad de la animación en fotogramas por segundo.


Devuelve el fotograma seleccionado de la animación.


Devuelve el número de fotogramas de la animación.


Si true, la animación nombrada existe.


  • void remove_animation ( String anim )

Elimina la animación dada.


Elimina el fotograma seleccionado de la animación.


Cambia el nombre de la animación a newname.


  • void set_animation_loop ( String anim, bool loop )

Si true, la animación se repetirá.


  • void set_animation_speed ( String anim, float speed )

La velocidad de la animación en fotogramas por segundo.


Establece la textura del fotograma dado.