Options
All
  • Public
  • Public/Protected
  • All
Menu

PIXI.Loader middleware for loading texture atlases that have been created with TexturePacker or similar JSON-based spritesheet.

This middleware automatically generates Texture resources.

If you're using Webpack or other bundlers and plan on bundling the atlas' JSON, use the PIXI.Spritesheet class to directly parse the JSON.

The Loader's image Resource name is automatically appended with "_image". If a Resource with this name is already loaded, the Loader will skip parsing the Spritesheet. The code below will generate an internal Loader Resource called "myatlas_image".

example

loader.add('myatlas', 'path/to/myatlas.json'); loader.load(() => { loader.resources.myatlas; // atlas JSON resource loader.resources.myatlas_image; // atlas Image resource });

memberof

PIXI

implements

PIXI.ILoaderPlugin

Hierarchy

  • SpritesheetLoader

Index

Constructors

Methods

Constructors

constructor

Methods

Static getResourcePath

  • Get the spritesheets root path

    Parameters

    • resource: ILoaderResource

      Resource to check path

    • baseUrl: string

      Base root url

    Returns string

Static use

  • Called after a resource is loaded.

    see

    PIXI.Loader.loaderMiddleware

    Parameters

    • resource: ILoaderResource
    • next: (...args: unknown[]) => void
        • (...args: unknown[]): void
        • Parameters

          • Rest ...args: unknown[]

          Returns void

    Returns void

Generated using TypeDoc