PIXI.AbstractMultiResource
class AbstractMultiResource extends PIXI.Resource
Resource that can manage several resource (items) inside. All resources need to have the same pixel size. Parent class for CubeResource and ArrayResource
Constructor
new PIXI.AbstractMultiResource(length: number, options: ISize) → {}
Name | Type | Attributes | Description |
---|---|---|---|
length | number | ||
options | ISize |
<optional> |
Options to for Resource constructor |
options.width | number |
<optional> |
Width of the resource |
options.height | number |
<optional> |
Height of the resource |
Summary
Properties from AbstractMultiResource
PIXI.BaseTexture |
Bound baseTexture, there can only be one. |
Array<number> |
|
Array<PIXI.BaseTexture> |
|
number |
Number of elements in array. |
Methods from AbstractMultiResource
this |
|
this |
|
void |
|
void |
Destroy this BaseImageResource. |
Promise<this> |
|
void |
|
void |
|
Properties inherited from Resource
boolean |
|
number |
|
boolean |
|
string |
The url of the resource |
boolean |
|
number |
|
number |
Internal height of the resource. |
number |
Internal width of the resource. |
Methods inherited from Resource
void |
|
void |
|
boolean |
|
void |
Has been updated trigger event. |
boolean |
|
Public Properties
baseTexture: PIXI.BaseTexture
Bound baseTexture, there can only be one.
items: Array<PIXI.BaseTexture>
Collection of partial baseTextures that correspond to resources.
Public Methods
addBaseTextureAt(baseTexture: PIXI.BaseTexture, index: number) → {this}
Set a baseTexture by ID
Name | Type | Description |
---|---|---|
baseTexture | PIXI.BaseTexture | |
index | number |
Zero-based index of resource to set |
Type | Description |
---|---|
this |
|
addResourceAt(resource: PIXI.Resource, index: number) → {this}
Set a resource by ID
Name | Type | Description |
---|---|---|
resource | PIXI.Resource | |
index | number |
Zero-based index of resource to set |
Type | Description |
---|---|
this |
|
bind(baseTexture: PIXI.BaseTexture) → {void}
Set the parent base texture.
Name | Type | Description |
---|---|---|
baseTexture | PIXI.BaseTexture |
Type | Description |
---|---|
void |
dispose() → {void}
Destroy this BaseImageResource.
Type | Description |
---|---|
void |
load() → {Promise<this>}
Load all the resources simultaneously
Type | Description |
---|---|
Promise<this> |
|
unbind(baseTexture: PIXI.BaseTexture) → {void}
Unset the parent base texture.
Name | Type | Description |
---|---|---|
baseTexture | PIXI.BaseTexture |
Type | Description |
---|---|
void |
Protected Methods
protected initFromArray(resources: Array, options: IAutoDetectOptions) → {void}
Used from ArrayResource and CubeResource constructors.
Name | Type | Attributes | Description |
---|---|---|---|
resources | Array<any> |
Can be resources, image elements, canvas, etc. , length should be same as constructor length |
|
options | IAutoDetectOptions |
<optional> |
Detect options for resources |
Type | Description |
---|---|
void |