PIXI.BufferResource

class BufferResource extends PIXI.Resource

Buffer resource with data of typed array.

Constructor


new PIXI.BufferResource(source: Float32Array | Uint8Array | Uint16Array | Int32Array | Uint32Array, options: ISize) → {}
Parameters:
Name Type Description
source Float32Array | Uint8Array | Uint16Array | Int32Array | Uint32Array

Source buffer

options ISize

Options

options.width number

Width of the texture

options.height number

Height of the texture

Summary


Properties from BufferResource

Float32Array | Uint8Array | Uint16Array | Int32Array | Uint32Array
data

Source array Cannot be ClampedUint8Array because it cant be uploaded to WebGL

Methods from BufferResource

boolean
static test(source: unknown)
void
dispose()

Destroy and don't use after this.

boolean
upload(renderer: PIXI.Renderer, baseTexture: 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

Public Properties


data BufferResource.ts:18
data: Float32Array | Uint8Array | Uint16Array | Int32Array | Uint32Array

Source array Cannot be ClampedUint8Array because it cant be uploaded to WebGL

Public Methods


test BufferResource.ts:98
static test(source: unknown) → {boolean}

Used to auto-detect the type of resource.

Parameters:
Name Type Description
source unknown

The source object

Returns:
Type Description
boolean

true if

dispose BufferResource.ts:92
dispose() → {void}

Destroy and don't use after this.

Returns:
Type Description
void
upload BufferResource.ts:41
upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture) → {boolean}

Upload the texture to the GPU.

Parameters:
Name Type Description
renderer PIXI.Renderer

Upload to the renderer

baseTexture PIXI.BaseTexture

Reference to parent texture

glTexture PIXI.GLTexture

glTexture

Returns:
Type Description
boolean
  • true is success

Powered by webdoc!