Animated Sprite
Scar::Components::AnimatedSprite
is a drawable which you can assign a spritesheet texture, a frame size and some state info to. Together with the Scar::Systems::AnimateSprites
system, it then gets updated every frame and drawn to the screen.
The state info is structured like this: A Hash mapping state names (Strings) to a tuple of three integers: index, framecount and framerate. Index is the offset into the spritesheet, counted in steps of the specified frame size in reading order. Framecount is the amount of successive frames the animation has. Framerate is the frequency at which the frames should cycle.
Last updated