LogoPixi’VN
pixi-jsInterfaces

Interface: BufferOptions

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/buffer/Buffer.d.ts:24

Options for creating a buffer

This interface defines the options that can be passed to the Buffer constructor. It includes the data to initialize the buffer with, the size of the buffer, the usage of the buffer, a label for debugging, and whether the buffer should shrink to fit when the data becomes smaller.

Advanced

Properties

data?

> optional data?: number[] | TypedArray

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/buffer/Buffer.d.ts:29

the data to initialize the buffer with, this can be a typed array, or a regular number array. If it is a number array, it will be converted to a Float32Array


label?

> optional label?: string

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/buffer/Buffer.d.ts:35

a label for the buffer, this is useful for debugging


shrinkToFit?

> optional shrinkToFit?: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/buffer/Buffer.d.ts:44

should the GPU buffer be shrunk when the data becomes smaller? changing this will cause the buffer to be destroyed and a new one created on the GPU this can be expensive, especially if the buffer is already big enough! setting this to false will prevent the buffer from being shrunk. This will yield better performance if you are constantly setting data that is changing size often.

Default

true

size?

> optional size?: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/buffer/Buffer.d.ts:31

the size of the buffer in bytes, if not supplied, it will be inferred from the data


usage

> usage: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/buffer/Buffer.d.ts:33

the usage of the buffer, see BufferUsage