Options to use when constructing a new Spritesheet.
Reference to the source BaseTexture object.
Spritesheet image data.
Optional
resolutionFilename: stringThe filename to consider when determining the resolution of the spritesheet. If not provided, the imageUrl will be used on the BaseTexture.
A map containing the textures for each animation. Can be used to create an PIXI.AnimatedSprite|AnimatedSprite:
import { AnimatedSprite } from 'pixi.js';
new AnimatedSprite(sheet.animations['anim_name']);
Reference to ths source texture.
Readonly
cachePrefix string to add to global cache
Reference to the original JSON data.
For multi-packed spritesheets, this contains a reference to all the other spritesheets it depends on.
The resolution of the spritesheet.
A map containing all textures of the sprite sheet. Can be used to create a PIXI.Sprite|Sprite:
import { Sprite } from 'pixi.js';
new Sprite(sheet.textures['image.png']);
Static
Readonly
BATCH_The maximum number of Textures to build per process.
Generated using TypeDoc
Utility class for maintaining reference to a collection of Textures on a single Spritesheet.
To access a sprite sheet from your code you may pass its JSON data file to Pixi's loader:
Alternately, you may circumvent the loader by instantiating the Spritesheet directly:
With the
sheet.textures
you can create Sprite objects, andsheet.animations
can be used to create an AnimatedSprite.Here's an example of a sprite sheet JSON data file:
Sprite sheets can be packed using tools like https://codeandweb.com/texturepacker|TexturePacker, https://renderhjs.net/shoebox/|Shoebox or https://github.com/krzysztof-o/spritesheet.js|Spritesheet.js. Default anchor points (see PIXI.Texture#defaultAnchor), default 9-slice borders (see PIXI.Texture#defaultBorders) and grouping of animation sprites are currently only supported by TexturePacker.
Alternative ways for loading spritesheet image if you need more control:
or:
Memberof
PIXI