Build an animation that can be rendered
A map with the valid animations. Note that you must include one for IDLE_E, since that is the default animation
The height of the animation
Optionaloffset?: JLOffsetAn offset between the component's center and its RigidBody's center (optional)
Optionalremap?: Map<AnimationState, AnimationState>A map that indicates when an animation for one state should be re-used for another state.
The width of the animation
Optionalz?: 0 | 1 | 2 | 4 | -4 | 3 | -3 | -2 | -1An optional z index in the range [-4,4]
The animation sequences to use (they correspond to different AnimationStates)
Height of the animation
An offset between the AnimatedSprite's center and the RigidBody's center
OptionalonOptional callback that runs whenever the active frame changes. Receives the new frame's 0-based index within the current AnimationSequence, and the AnimationState that sequence corresponds to.
A function for selecting what animation state to move to when the attached actor's state changes. Defaults to the version for overhead-style games.
Figure out what AnimationState to use, given an ActorState. This version is designed for top-down style games, where the camera seems to be overhead.
NB: This is the default version, but there's no guarantee that it is very good. It is used via stateSelector, which can be overridden. Or you could chose to modify it for your game.
The state that the actor was in
The details of the new state the actor is moving to
Width of the animation
Z index of the image
The AnimationState corresponding to the currently running animation, e.g., for finding out which way the sprite is facing
The current image for the active animation
When the attached Actor's state changes, figure out if the animation needs to change
The actor whose state is changing.
The event that might have caused actor's state to change
The new state of actor
The old state of actor
Render the animated image's current cell when it does not have a rigidBody. This is only used for Parallax
The center x/y at which to draw the image
The camera for the current stage
Should this go in the foreground (true) or background (false)
Restart the current animation
Skip to the indexth cell of the animation, and move forward within it by
elapsed milliseconds. Does nothing (and prints no error) if the index is
out of bounds.
The 0-based index of the cell of the animation within the current AnimationSequence
Act as if this many milliseconds within the new cell have passed.
StaticoverheadFigure out what AnimationState to use, given an ActorState. This version is designed for top-down style games, where the camera seems to be overhead.
NB: This is the default version, but there's no guarantee that it is very good. It is used via stateSelector, which can be overridden. Or you could chose to modify it for your game.
The state that the actor was in
The details of the new state the actor is moving to
StaticsideFigure out what AnimationState to use, given an ActorState. This version is designed for side-view style games, where the camera seems to be at ground level.
NB: As in overheadAnimationTransitions, this may not be good for your game, so you can always override it or rewrite it.
The state that the actor was in
The details of the new state the actor is moving to
The new AnimationState for the actor
AnimatedSprite describes any object whose visual representation is an animation. There can be many types of animations. The "IDLE_E" (right-facing) animation is the default. AnimatedSprite can be notified when an Entity's state changes, so that it can switch to the animation associated with the new state.