Class: ArrayResource

PIXI.resources.ArrayResource

A resource that contains a number of sources.

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

Extends

Members

_height number protected inherited

Internal height of the resource

_width number protected inherited

Internal width of the resource

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.

valid boolean readonly inherited

Has been validated

width number readonly inherited

The width of the resource.

Methods

addBaseTextureAt (baseTexture, index)PIXI.resources.ArrayResource

Set a baseTexture by ID, ArrayResource just takes resource from it, nothing more

Name Type Description
baseTexture PIXI.BaseTexture
index number

Zero-based index of resource to set

Returns:
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

Clean up anything, this happens when destroying is ready.

load ()Promise.<void> protected inherited

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

Returns:
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

Returns:
Type Description
boolean true is success

unbind (baseTexture) inherited

Unbind to a parent BaseTexture

Name Type Description
baseTexture PIXI.BaseTexture

Parent texture

Has been updated trigger event

upload (renderer, texture, glTexture)boolean

Upload the resources to the GPU.

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