AnimatedSprite

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.

@GodotBaseClass
struct AnimatedSprite {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_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()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

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]

The SpriteFrames resource containing the animation(s).

offset
Vector2 offset [@property getter]
Vector2 offset [@property setter]

The texture's drawing offset.

playing
bool playing [@property getter]
bool playing [@property setter]

If true, the animation is currently playing.

speedScale
double speedScale [@property getter]
double speedScale [@property setter]

The animation speed is multiplied by this value.

Static functions

_new
AnimatedSprite _new()

Construct a new instance of AnimatedSprite. Note: use memnew!AnimatedSprite instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta