Class: Buffer

PIXI. Buffer

A wrapper for data so that it can be used and uploaded by webGL

new PIXI.Buffer(data)

Name Type Description
data ArrayBuffer | SharedArrayBuffer | ArrayBufferView

the data to store in the buffer.

Members

float32ViewFloat32Array

View on the vertices as a Float32Array for positions

uint32ViewFloat32Array

View on the vertices as a Uint32Array for uvs

Methods

staticPIXI.Buffer.from(data){PIXI.mesh.Buffer}

Helper function that creates a buffer based on an array or TypedArray

Name Type Description
data TypedArray | Array

the TypedArray that the buffer will store. If this is a regular Array it will be converted to a Float32Array.

Returns:
Type Description
PIXI.mesh.Buffer A new Buffer based on the data provided.

Destroys the buffer.

Destroys the buffer

flags this buffer as requiring an upload to the GPU

PIXI. Buffer

new PIXI.Buffer(size)

Name Type Description
size number

The size of the buffer in bytes.

Members

float32ViewFloat32Array

View on the vertices as a Float32Array for positions

uint32ViewFloat32Array

View on the vertices as a Uint32Array for uvs

Methods

staticPIXI.Buffer.from(data){PIXI.mesh.Buffer}

Helper function that creates a buffer based on an array or TypedArray

Name Type Description
data TypedArray | Array

the TypedArray that the buffer will store. If this is a regular Array it will be converted to a Float32Array.

Returns:
Type Description
PIXI.mesh.Buffer A new Buffer based on the data provided.

Destroys the buffer.

Destroys the buffer

flags this buffer as requiring an upload to the GPU