Class: CubeResource

PIXI.resources.CubeResource

Resource for a CubeTexture which contains six resources.

new PIXI.resources.CubeResource (source, options)

Name Type Description
source Array.<(string|PIXI.resources.Resource)> optional

Collection of URLs or resources to use as the sides of the cube.

options object optional

ImageResource options

Name Type Description
width number optional

Width of resource

height number optional

Height of resource

Extends

Members

PIXI.resources.CubeResource.SIDES number static

Number of texture sides to store for CubeResources

Default Value:
  • 6

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

itemDirtyIds Array.<number> readonly inherited

Dirty IDs for each part

items Array.<PIXI.BaseTexture> readonly inherited

Collection of resources.

length number readonly inherited

Number of elements in array

valid boolean readonly inherited

Has been validated

width number readonly inherited

The width of the resource.

Methods

PIXI.resources.CubeResource.test (source)boolean static

Used to auto-detect the type of resource.

Name Type Description
source object

The source object

Returns:
Type Description
boolean true if source is an array of 6 elements

Set a resource by ID

Name Type Description
resource PIXI.resources.Resource
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

unbind (baseTexture) inherited

Unbind to a parent BaseTexture

Name Type Description
baseTexture PIXI.BaseTexture

Parent texture

Has been updated trigger event

upload ()boolean overrides

Upload the resource

Returns:
Type Description
boolean true is success