Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
use the Promise-based version of spritesheet.parse (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
mindcitycode committed Oct 26, 2022
1 parent 66f897f commit df1c149
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/basics/sprite-sheets.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ const spritesheet = new PIXI.Spritesheet(
);

// Generate all the Textures asynchronously
spritesheet.parse(() => {
// spritesheet is ready to use!
const anim = new PIXI.AnimatedSprite(spritesheet.animations.enemy);
});
await spritesheet.parse();

// spritesheet is ready to use!
const anim = new PIXI.AnimatedSprite(spritesheet.animations.enemy);
```

0 comments on commit df1c149

Please sign in to comment.