animation
FreeBodyEngine.graphics.animation
#
Animation(name, frames, loop=True)
dataclass
#
AnimationFrame(texture, duration)
dataclass
#
AnimationPlayer(animation_set, default=None)
#
Advances an AnimationSet's frames over time for a single sprite instance.
Starts playback of default (or, if omitted, whichever
animation happens to be first in animation_set - dict insertion
order, i.e. the order it was defined in the .fbanim file) at its
first frame.
animation
property
#
The Animation currently playing.
animation_set = animation_set
instance-attribute
#
current_animation = default
instance-attribute
#
elapsed = 0.0
instance-attribute
#
frame
property
#
The frame currently being displayed.
frame_index = 0
instance-attribute
#
set_animation(name, restart=False)
#
Switches playback to the animation named name. If it's already
the current animation, this is a no-op unless restart is True, in
which case playback jumps back to frame 0. Warns and does nothing
if name doesn't exist in this player's AnimationSet.
update(dt)
#
Advances playback by dt seconds. Returns True if the current frame changed.