- _isPlaying
bool _isPlaying()
- _resChanged
void _resChanged()
- _setPlaying
void _setPlaying(bool playing)
- getAnimation
String getAnimation()
- getFrame
long getFrame()
- getOffset
Vector2 getOffset()
- getSpeedScale
double getSpeedScale()
- getSpriteFrames
Ref!SpriteFrames getSpriteFrames()
- isCentered
bool isCentered()
- isFlippedH
bool isFlippedH()
- isFlippedV
bool isFlippedV()
- isPlaying
bool isPlaying()
Returns true if an animation is currently being played.
- opAssign
typeof(null) opAssign(typeof(null) n)
- opEquals
bool opEquals(AnimatedSprite other)
- opEquals
bool opEquals(typeof(null) n)
- play
void play(String anim, bool backwards)
Plays the animation named anim. If no anim is provided, the current animation is played. If backwards is true, the animation will be played in reverse.
- setAnimation
void setAnimation(String animation)
- setCentered
void setCentered(bool centered)
- setFlipH
void setFlipH(bool flip_h)
- setFlipV
void setFlipV(bool flip_v)
- setFrame
void setFrame(long frame)
- setOffset
void setOffset(Vector2 offset)
- setSpeedScale
void setSpeedScale(double speed_scale)
- setSpriteFrames
void setSpriteFrames(SpriteFrames sprite_frames)
- stop
void stop()
Stops the current animation (does not reset the frame counter).
- toHash
size_t toHash()
- animation
String animation [@property getter]
String animation [@property setter]
The current animation from the frames resource. If this value changes, the frame counter is reset.
- centered
bool centered [@property getter]
bool centered [@property setter]
If true, texture will be centered.
- flipH
bool flipH [@property getter]
bool flipH [@property setter]
If true, texture is flipped horizontally.
- flipV
bool flipV [@property getter]
bool flipV [@property setter]
If true, texture is flipped vertically.
- frame
long frame [@property getter]
long frame [@property setter]
The displayed animation frame's index.
- frames
SpriteFrames frames [@property getter]
SpriteFrames frames [@property setter]
- offset
Vector2 offset [@property getter]
Vector2 offset [@property setter]
The texture's drawing offset.
- playing
bool playing [@property getter]
bool playing [@property setter]
- speedScale
double speedScale [@property getter]
double speedScale [@property setter]
The animation speed is multiplied by this value.
Sprite node that can use multiple textures for animation.
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.