crystal.Animation

Animation within a Spritesheet. An animation contains one or more Sequence.

Constructor

You cannot construct animations manually. Use crystal.assets.get to load a Spritesheet containing animations.

Methods

Name Description
num_repeat Returns how many times this animation plays before stopping.
sequence Retrieves a sequence by name.

Examples

local spritesheet = crystal.assets.get("assets/sprites/hero.json");
local walk = spritesheet:animation("walk");
local sequence = walk:sequence("W");
print(sequence:duration());

This site uses Just the Docs, a documentation theme for Jekyll.