Skip to content

Commit

Permalink
Add documentation for Spritesheet usage without Loader (pixijs#8321)
Browse files Browse the repository at this point in the history
  • Loading branch information
forgetfulanthropod committed May 11, 2022
1 parent 23ab209 commit f07d003
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/spritesheet/src/Spritesheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface ISpritesheetData {
* Utility class for maintaining reference to a collection
* of Textures on a single Spritesheet.
*
* To access a sprite sheet from your code pass its JSON data file to Pixi's loader:
* To access a sprite sheet from your code you may pass its JSON data file to Pixi's loader:
*
* ```js
* PIXI.Loader.shared.add("images/spritesheet.json").load(setup);
Expand All @@ -53,6 +53,13 @@ export interface ISpritesheetData {
* ...
* }
* ```
*
* Alternately, you may circumvent the loader by instantiating the Spritesheet directly:
* ```js
* const sheet = new PIXI.Spritesheet(texture, spritesheetData);
* sheet.parse(() => console.log('Spritesheet ready to use!'));
* ```
*
* With the `sheet.textures` you can create Sprite objects,`sheet.animations` can be used to create an AnimatedSprite.
*
* Sprite sheets can be packed using tools like {@link https://codeandweb.com/texturepacker|TexturePacker},
Expand Down

0 comments on commit f07d003

Please sign in to comment.