Class: AbstractMultiResource


Resource that can manage several resource (items) inside. All resources need to have the same pixel size. Parent class for CubeResource and ArrayResource

new PIXI.resources.AbstractMultiResource (options)

Name Type Description
options object optional

Options to for Resource constructor

Name Type Description
width number optional

Width of the resource

height number optional

Height of the resource



_height number protected inherited

Internal height of the resource

_width number protected inherited

Internal width of the resource

baseTexture PIXI.BaseTexture

Bound baseTexture, there can only be one

destroyed boolean readonly inherited

If resource has been destroyed

Default Value:
  • false

height number readonly inherited

The height of the resource.

internal boolean protected inherited

true if resource is created by BaseTexture useful for doing cleanup with BaseTexture destroy and not cleaning up resources that were created externally.

itemDirtyIds Array.<number> readonly

Dirty IDs for each part

items Array.<PIXI.BaseTexture> readonly

Collection of partial baseTextures that correspond to resources

length number readonly

Number of elements in array

valid boolean readonly inherited

Has been validated

width number readonly inherited

The width of the resource.


Set a resource by ID

Name Type Description
resource PIXI.resources.Resource
index number

Zero-based index of resource to set

Type Description
PIXI.resources.ArrayResource Instance for chaining

bind (baseTexture) inherited overrides

Bind to a parent BaseTexture

Name Type Description
baseTexture PIXI.BaseTexture

Parent texture

Call when destroying resource, unbind any BaseTexture object before calling this method, as reference counts are maintained internally.

dispose () protected inherited overrides

Clean up anything, this happens when destroying is ready.

initFromArray (resources, options) protected

used from ArrayResource and CubeResource constructors

Name Type Description
resources Array.<*>

Can be resources, image elements, canvas, etc. , length should be same as constructor length

options object optional

detect options for resources

load ()Promise.<void> protected inherited overrides

This can be overridden to start preloading a resource or do any other prepare step.

Type Description
Promise.<void> Handle the validate event

resize (width, height) inherited

Trigger a resize event

Name Type Description
width number

X dimension

height number

Y dimension

style (renderer, baseTexture, glTexture)boolean inherited

Set the style, optional to override

Name Type Description
renderer PIXI.Renderer

yeah, renderer!

baseTexture PIXI.BaseTexture

the texture

glTexture PIXI.GLTexture

texture instance for this webgl context

Type Description
boolean true is success

unbind (baseTexture) inherited overrides

Unbind to a parent BaseTexture

Name Type Description
baseTexture PIXI.BaseTexture

Parent texture

Has been updated trigger event