PIXI.Buffer

class Buffer

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

Constructor


new PIXI.Buffer(data: PIXI.IArrayBuffer, _static: boolean, index: boolean) → {}
Parameters:
Name Type Attributes Default Description
data PIXI.IArrayBuffer

<optional>

the data to store in the buffer.

_static boolean true

true for static buffer

index boolean false

true for index buffer

Summary


Properties from Buffer

PIXI.IArrayBuffer
data
boolean
index

Flags whether this is an index buffer.

PIXI.BUFFER_TYPE
type

Methods from Buffer

PIXI.Buffer
static from(data: ArrayBufferView | number<Array>)
void
destroy()

Destroys the buffer.

void
dispose()

Disposes WebGL resources that are connected to this geometry.

void
update(data: PIXI.IArrayBuffer | number<Array>)

Public Properties


data Buffer.ts:38
data: PIXI.IArrayBuffer

The data in the buffer, as a typed array

index Buffer.ts:112
index: boolean

Flags whether this is an index buffer.

Index buffers are of type ELEMENT_ARRAY_BUFFER. Note that setting this property to false will make the buffer of type ARRAY_BUFFER.

For backwards compatibility.

type Buffer.ts:44
type: PIXI.BUFFER_TYPE

The type of buffer this is, one of:

  • ELEMENT_ARRAY_BUFFER - used as an index buffer
  • ARRAY_BUFFER - used as an attribute buffer
  • UNIFORM_BUFFER - used as a uniform buffer (if available)

Public Methods


from Buffer.ts:130
static from(data: ArrayBufferView | number<Array>) → {PIXI.Buffer}

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

Parameters:
Name Type Description
data ArrayBufferView | number<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.Buffer
  • A new Buffer based on the data provided.
destroy Buffer.ts:104
destroy() → {void}

Destroys the buffer.

Returns:
Type Description
void
dispose Buffer.ts:98
dispose() → {void}

Disposes WebGL resources that are connected to this geometry.

Returns:
Type Description
void
update Buffer.ts:84
update(data: PIXI.IArrayBuffer | number<Array>) → {void}

Flags this buffer as requiring an upload to the GPU.

Parameters:
Name Type Attributes Description
data PIXI.IArrayBuffer | number<Array>

<optional>

the data to update in the buffer.

Returns:
Type Description
void

Powered by webdoc!