Docs
Characters
Loading a character, its idle loop and its reactions.
const hero = await gs.character('./sprites/character-1/', { height: 300 });
hero.position.set(400, 420);
app.stage.addChild(hero);
hero.play('idle'); // loops
await hero.play('happy'); // a reaction
hero.play('idle'); // back to the loopA character's idle is made as a loop; reactions are one-shots that end facing the viewer in the starting pose, so the idle can follow at once. A calm character that mostly idles reads better than one that reacts all the time.
height is the height you draw the character at; the default for characters is 448.