Animation Documentation
These functions are helper functions for handling tilebased animations in BeepMini. They are used by the Actors and Vfx systems to manage and render animations based on delta time.
Animation Methods
b8.Animation.frame(animation, startTime)
Get the current frame of an animation. This is used internally to automatically determine what frame to draw. This uses delta time to determine the current frame.
Parameters
- animation (string): The animation to get the frame for.
- startTime (number|null): The start time of the animation. If null, uses the core start time.
Returns
- (number): The frame to draw for the animation.
b8.Animation.get(animation)
Get animation by id.
Parameters
- animation (string): The animation id.
Returns
- (Object|undefined): The animation object, or undefined if not found.
b8.Animation.shouldLoop(anim, startTime)
Checks if the animation has finished looping.
Parameters
- anim (Object): The animation object.
- startTime (number): The start time of the animation.
Returns
- (boolean): - Returns true if the animation should continue, false if it has finished looping.