Moai SDK  2.0
MOAIVertexFormat Class Reference

Inherits MOAILuaObject.

Function List

declareAttribute
 
declareColor
 
declareCoord
 
declareNormal
 
declareUV
 
getVertexSize
 

Function Documentation

declareAttribute

Declare a custom attribute (for use with programmable pipeline).


function declareAttribute ( MOAIVertexFormat self, number index, number type, number size [, boolean normalized, number use ] )

Parameters
MOAIVertexFormatself
numberindex Default value is 1.
numbertype Data type of component elements. See OpenGL ES documentation.
numbersize Number of elements. See OpenGL ES documentation.
booleannormalized Optional. See OpenGL ES documentation.
numberuse Optional. One of MOAIVertexFormat.ATTRIBUTE_COLOR, MOAIVertexFormat.ATTRIBUTE_NORMAL, MOAIVertexFormat.ATTRIBUTE_TEX_COORD, MOAIVertexFormat.ATTRIBUTE_COORD, MOAIVertexFormat.VERTEX_USER,
Returns
nil
declareColor

Declare a vertex color.


function declareColor ( MOAIVertexFormat self, number index, number type )

Parameters
MOAIVertexFormatself
numberindex
numbertype Data type of component elements. See OpenGL ES documentation.
Returns
nil
declareCoord

Declare a vertex coordinate.


function declareCoord ( MOAIVertexFormat self, number index, number type, number size )

Parameters
MOAIVertexFormatself
numberindex
numbertype Data type of coordinate elements. See OpenGL ES documentation.
numbersize Number of coordinate elements. See OpenGL ES documentation.
Returns
nil
declareNormal

Declare a vertex normal.


function declareNormal ( MOAIVertexFormat self, number index, number type )

Parameters
MOAIVertexFormatself
numberindex
numbertype Data type of normal elements. See OpenGL ES documentation.
Returns
nil
declareUV

Declare a vertex texture coordinate.


function declareUV ( MOAIVertexFormat self, number index, number type, number size )

Parameters
MOAIVertexFormatself
numberindex
numbertype Data type of texture coordinate elements. See OpenGL ES documentation.
numbersize Number of texture coordinate elements. See OpenGL ES documentation.
Returns
nil
getVertexSize

Return the size (in bytes) of the vertex described by the vertex format.


function getVertexSize ( MOAIVertexFormat self )

Parameters
MOAIVertexFormatself
Returns
number vertexSizeInBytes