crystal.Sequence

Sequence within an Animation. A sequence contains keyframes.

Constructor

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

Methods

Name Description
duration Returns the duration of this sequence in seconds.
keyframe_at Retrieves the keyframe to play at a specific time.

Examples

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

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