TextileResource
class TextileResource extends PIXI.Resource
This texture tiling resource can be used to upload multiple base-textures together.
This resource combines multiple base-textures into a "textile". They're laid out in a dual column format, placed in row-order order. The size of each tile is predefined, and defaults to settings.TEXTILE_DIMEN. This means that each input base-texture must is smaller than that along both its width and height.
Constructor
new TextileResource(options: TextileOptions) → {}
| Name | Type | Description |
|---|---|---|
| options | TextileOptions |
This will default to the "settings" exported by @pixi/tilemap. |
| options.TEXTILE_DIMEN |
The dimensions of each tile. |
|
| options.TEXTILE_UNITS |
The number of texture tiles. |
Summary
Properties from TextileResource
| PIXI.BaseTexture |
The base-texture that contains all the texture tiles. |
Methods from TextileResource
| void |
|
| void |
Sets the texture to be uploaded for the given tile. |
| boolean |
|
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 |
Clean up anything, this happens when destroying is ready. |
| void |
|
| boolean |
|
| void |
|
| void |
Has been updated trigger event. |
| Promise<PIXI.Resource> |
|
Public Properties
baseTexture: PIXI.BaseTexture = undefined
The base-texture that contains all the texture tiles.
Public Methods
bind(baseTexture: PIXI.BaseTexture) → {void}
| Name | Type | Description |
|---|---|---|
| baseTexture | PIXI.BaseTexture |
| Type | Description |
|---|---|
| void |
tile(index: number, texture: PIXI.BaseTexture) → {void}
Sets the texture to be uploaded for the given tile.
| Name | Type | Description |
|---|---|---|
| index | number |
The index of the tile being set. |
| texture | PIXI.BaseTexture |
The texture with the base-texture to upload. |
| Type | Description |
|---|---|
| void |
upload(renderer: PIXI.Renderer, texture: PIXI.BaseTexture, glTexture: PIXI.GLTexture) → {boolean}
| Name | Type | Description |
|---|---|---|
| renderer | PIXI.Renderer | |
| texture | PIXI.BaseTexture | |
| glTexture | PIXI.GLTexture |
| Type | Description |
|---|---|
| boolean |