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 Attributes Default Description
buffer string

the id of the buffer that this attribute will look for

size Number <optional>
0

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

normalized Boolean <optional>
false

should the data be normalized.

type Number <optional>
PIXI.TYPES.FLOAT

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

stride Number <optional>
0

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

start Number <optional>
0

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

Methods

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

Helper function that creates an Attribute based on the information provided

Name Type Attributes Default Description
buffer string

the id of the buffer that this attribute will look for

size Number <optional>
0

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

normalized Boolean <optional>
false

should the data be normalized.

type Number <optional>
PIXI.TYPES.FLOAT

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

stride Number <optional>
0

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 () void

Destroys the Attribute.