Class: ArrayResource


A resource that contains a number of sources.

new ArrayResource (source, options)

Name Type Description
source number | Array.<*>

Number of items in array or the collection of image URLs to use. Can also be resources, image elements, canvas, etc.

options object optional

Options to apply to PIXI.resources.autoDetectResource

Name Type Description
width number optional

Width of the resource

height number optional

Height of the resource



_height number protected inherited overrides

Internal height of the resource

_width number protected inherited overrides

Internal width of the resource

Set the parent base texture

destroyed boolean readonly inherited overrides

If resource has been destroyed

Default Value:
  • false

height number readonly inherited overrides

The height of the resource.

internal boolean protected inherited overrides

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 resources.

length number readonly

Number of elements in array

Unset the parent base texture

valid boolean readonly inherited overrides

Has been validated

width number readonly inherited overrides

The width of the resource.


addResourceAt (resource, index)PIXI.resources.ArrayResource

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

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

dispose () protected inherited overrides

Destroy this BaseImageResource

load ()Promise.<void> protected inherited overrides

Load all the resources simultaneously

Type Description
Promise.<void> When load is resolved

resize (width, height) inherited overrides

Trigger a resize event

Name Type Description
width number

X dimension

height number

Y dimension

style (renderer, baseTexture, glTexture)boolean inherited overrides

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

Has been updated trigger event

upload (renderer, texture, glTexture)boolean overrides

Upload the resources to the GPU.

Name Type Description
renderer PIXI.Renderer
texture PIXI.BaseTexture
glTexture PIXI.GLTexture
Type Description
boolean whether texture was uploaded