Namespace: extensions

PIXI.extensions

Global registration of all PixiJS extensions. One-stop-shop for extensibility.

Methods

add (…extensions) PIXI.extensions

Register new extensions with PixiJS.

Name Type Description
extensions Array<PIXI.ExtensionFormatLoose | any>

The spread of extensions to add to PixiJS.

Returns:
Type Description
PIXI.extensions For chaining.

handle (type, onAdd, onRemove) PIXI.extensions

Internal method to handle extensions by name.

Name Type Description
type PIXI.ExtensionType

The extension type.

onAdd ExtensionHandler

Function for handling when extensions are added/registered passes PIXI.ExtensionFormat.

onRemove ExtensionHandler

Function for handling when extensions are removed/unregistered passes PIXI.ExtensionFormat.

Returns:
Type Description
PIXI.extensions For chaining.

handleByList (type, list, defaultPriority) PIXI.extensions

Handle a type, but using a list of extensions.

Name Type Default Description
type PIXI.ExtensionType

Type of extension to handle.

list any[]

The list of extensions.

defaultPriority number -1

The default priority to use if none is specified.

Returns:
Type Description
PIXI.extensions For chaining.

handleByMap (type, map) PIXI.extensions

Handle a type, but using a map by name property.

Name Type Description
type PIXI.ExtensionType

Type of extension to handle.

map Record<string, any>

The object map of named extensions.

Returns:
Type Description
PIXI.extensions For chaining.

remove (…extensions) PIXI.extensions

Remove extensions from PixiJS.

Name Type Description
extensions Array<PIXI.ExtensionFormatLoose | any>

Extensions to be removed.

Returns:
Type Description
PIXI.extensions For chaining.