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.

See: settings.TEXTILE_UNITS

Constructor


new TextileResource(options: TextileOptions) → {}
Parameters:
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
baseTexture = undefined

The base-texture that contains all the texture tiles.

Methods from TextileResource

void
bind(baseTexture: PIXI.BaseTexture)
void
tile(index: number, texture: PIXI.BaseTexture)

Sets the texture to be uploaded for the given tile.

boolean
upload(renderer: PIXI.Renderer, texture: PIXI.BaseTexture, glTexture: PIXI.GLTexture)

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 Resource

void
destroy()
void
dispose()

Clean up anything, this happens when destroying is ready.

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

Has been updated trigger event.

Promise<PIXI.Resource>
protected load()

Public Properties


baseTexture TextileResource.ts:34
baseTexture: PIXI.BaseTexture = undefined

The base-texture that contains all the texture tiles.

Public Methods


bind TextileResource.ts:92
bind(baseTexture: PIXI.BaseTexture) → {void}
Parameters:
Name Type Description
baseTexture PIXI.BaseTexture
Returns:
Type Description
void
tile TextileResource.ts:71
tile(index: number, texture: PIXI.BaseTexture) → {void}

Sets the texture to be uploaded for the given tile.

Parameters:
Name Type Description
index number

The index of the tile being set.

texture PIXI.BaseTexture

The texture with the base-texture to upload.

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

Powered by webdoc!