UNPKG

2.3 kBTypeScriptView Raw
1import { TYPES } from '@pixi/constants';
2/**
3 * Holds the information for a single attribute structure required to render geometry.
4 *
5 * This does not contain the actual data, but instead has a buffer id that maps to a {@link PIXI.Buffer}
6 * This can include anything from positions, uvs, normals, colors etc.
7 * @memberof PIXI
8 */
9export declare class Attribute {
10 buffer: number;
11 size: number;
12 normalized: boolean;
13 type: TYPES;
14 stride: number;
15 start: number;
16 instance: boolean;
17 divisor: number;
18 /**
19 * @param buffer - the id of the buffer that this attribute will look for
20 * @param size - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2.
21 * @param normalized - should the data be normalized.
22 * @param {PIXI.TYPES} [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available
23 * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)
24 * @param [start=0] - How far into the array to start reading values (used for interleaving data)
25 * @param [instance=false] - Whether the geometry is instanced.
26 * @param [divisor=1] - Divisor to use when doing instanced rendering
27 */
28 constructor(buffer: number, size?: number, normalized?: boolean, type?: TYPES, stride?: number, start?: number, instance?: boolean, divisor?: number);
29 /** Destroys the Attribute. */
30 destroy(): void;
31 /**
32 * Helper function that creates an Attribute based on the information provided
33 * @param buffer - the id of the buffer that this attribute will look for
34 * @param [size=0] - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
35 * @param [normalized=false] - should the data be normalized.
36 * @param [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available
37 * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)
38 * @returns - A new {@link PIXI.Attribute} based on the information provided
39 */
40 static from(buffer: number, size?: number, normalized?: boolean, type?: TYPES, stride?: number): Attribute;
41}