Class: Attribute

PIXI.Attribute

Holds the information for a single attribute structure required to render geometry.

This does not contain the actual data, but instead has a buffer id that maps to a PIXI.Buffer This can include anything from positions, uvs, normals, colors etc.

new PIXI.Attribute (buffer, size, normalized, type, stride, start)

Name Type Default Description
buffer string

the id of the buffer that this attribute will look for

size Number 0 optional

the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2.

normalized Boolean false optional

should the data be normalized.

type Number PIXI.TYPES.FLOAT optional

what type of number is the attribute. Check PIXI.TYPES to see the ones available

stride Number 0 optional

How far apart (in floats) the start of each value is. (used for interleaving data)

start Number 0 optional

How far into the array to start reading values (used for interleaving data)

Methods

PIXI.Attribute.from (buffer, size, normalized, start, type, stride)PIXI.Attribute static

Helper function that creates an Attribute based on the information provided

Name Type Default Description
buffer string

the id of the buffer that this attribute will look for

size Number 0 optional

the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2

normalized Boolean false optional

should the data be normalized.

start Number 0 optional

How far into the array to start reading values (used for interleaving data)

type Number PIXI.TYPES.FLOAT optional

what type of number is the attribute. Check PIXI.TYPES to see the ones available

stride Number 0 optional

How far apart (in floats) the start of each value is. (used for interleaving data)

Returns:
Type Description
PIXI.Attribute A new PIXI.Attribute based on the information provided

destroy ()

Destroys the Attribute.