Class: AbstractMultiResource

PIXI.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.AbstractMultiResource (length, options) overrides

Name Type Attributes Description
length number
options object <optional>

Options to for Resource constructor

options.width number <optional>

Width of the resource

options.height number <optional>

Height of the resource

Extends

Members

baseTexture PIXI.BaseTexture

Bound baseTexture, there can only be one

Set the parent base texture

itemDirtyIds Array

Dirty IDs for each part

items Array<PIXI.BaseTexture>

Collection of partial baseTextures that correspond to resources

length number

Number of elements in array

Unset the parent base texture

Methods

addBaseTextureAt (baseTexture, index) PIXI.AbstractMultiResource abstract

Set a baseTexture by ID

Name Type Description
baseTexture PIXI.BaseTexture
index number

Zero-based index of resource to set

Returns:
Type Description
PIXI.AbstractMultiResource Instance for chaining

addResourceAt (resource, index) PIXI.ArrayResource

Set a resource by ID

Name Type Description
resource PIXI.Resource
index number

Zero-based index of resource to set

Returns:
Type Description
PIXI.ArrayResource Instance for chaining

Destroy this BaseImageResource

Load all the resources simultaneously

Returns:
Type Description
Promise When load is resolved

initFromArray (resources, options) void protected

used from ArrayResource and CubeResource constructors

Name Type Attributes Description
resources Array

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

options object <optional>

detect options for resources

Inherited Properties

From class PIXI.Resource

destroyed boolean inherited

If resource has been destroyed

Default Value:
  • false

height number inherited

The height of the resource.

valid boolean inherited

Has been validated

width number inherited

The width of the resource.

_height number protected inherited

Internal height of the resource

_width number protected inherited

Internal width 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.

Inherited Methods

From class PIXI.Resource

destroy () void inherited

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

resize (width, height) void 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

update () void inherited

Has been updated trigger event

upload (renderer, baseTexture, glTexture) boolean abstract inherited

Uploads the texture or returns false if it cant for some reason. Override this.

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