PIXI.ArrayResource

class ArrayResource extends PIXI.AbstractMultiResource

A resource that contains a number of sources.

Constructor


new PIXI.ArrayResource(source: number | Array, options: ISize) → {}
Parameters:
Name Type Attributes Description
source number | Array<any>

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

options ISize

<optional>

Options to apply to PIXI.autoDetectResource

options.width number

<optional>

Width of the resource

options.height number

<optional>

Height of the resource

Summary


Properties inherited from AbstractMultiResource

PIXI.BaseTexture
baseTexture

Bound baseTexture, there can only be one.

Array<number>
itemDirtyIds
Array<PIXI.BaseTexture>
items
number
length

Number of elements in array.

Properties inherited from Resource

boolean
destroyed = false
number
height
boolean
internal
string
src

The url of the resource

boolean
valid
number
width
number
protected _height

Internal height of the resource.

number
protected _width

Internal width of the resource.

Methods inherited from AbstractMultiResource

Methods inherited from Resource

void
destroy()
void
resize(width: number, height: number)
boolean
style(_renderer: PIXI.Renderer, _baseTexture: PIXI.BaseTexture, _glTexture: PIXI.GLTexture)
void
update()

Has been updated trigger event.

Public Methods


addBaseTextureAt ArrayResource.ts:48
addBaseTextureAt(baseTexture: PIXI.BaseTexture, index: number) → {this}

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

Parameters:
Name Type Description
baseTexture PIXI.BaseTexture
index number

Zero-based index of resource to set

Returns:
Type Description
this
  • Instance for chaining
bind ArrayResource.ts:69
bind(baseTexture: PIXI.BaseTexture) → {void}

Add binding

Parameters:
Name Type Description
baseTexture PIXI.BaseTexture
Returns:
Type Description
void
upload ArrayResource.ts:80
upload(renderer: PIXI.Renderer, texture: PIXI.BaseTexture, glTexture: PIXI.GLTexture) → {boolean}

Upload the resources to the GPU.

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

Powered by webdoc!