Class: Buffer

PIXI.Buffer

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

new PIXI.Buffer (data, _static, index)

Name Type Default Description
data ArrayBuffer | SharedArrayBuffer | ArrayBufferView

the data to store in the buffer.

_static boolean true optional

true for static buffer

index boolean false optional

true for index buffer

Members

data ArrayBuffer | SharedArrayBuffer | ArrayBufferView

The data in the buffer, as a typed array

Methods

PIXI.Buffer.from (data)PIXI.Buffer static

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

Name Type Description
data ArrayBufferView | Array.<number>

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

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

destroy ()

Destroys the buffer

dispose ()

disposes WebGL resources that are connected to this geometry

update (data)

flags this buffer as requiring an upload to the GPU

Name Type Description
data ArrayBuffer | SharedArrayBuffer | ArrayBufferView optional

the data to update in the buffer.