Moai SDK  2.0
MOAIMaterialBatch Class Reference

Inherits MOAILuaObject.

Function List

getIndexBatchSize
 
reserveMaterials
 
setBlendMode
 
setIndexBatchSize
 

Function Documentation

getIndexBatchSize

Get the index batch size.


function getIndexBatchSize ( MOAIMaterialBatch self )

Parameters
MOAIMaterialBatchself
Returns
number indexBatchSize
reserveMaterials

Reserve material indices.


function reserveMaterials ( MOAIMaterialBatch self [, number count ] )

Parameters
MOAIMaterialBatchself
numbercount Optional.
Returns
nil
setBlendMode

function Set blend mode using OpenGL source and dest factors. OpenGl blend factor constants are exposed as members of MOAIMaterialBatch. See the OpenGL documentation for an explanation of blending constants. ( MOAIMaterialBatch self, number srcFactor, number dstFactor )

Parameters
MOAIMaterialBatchself
numbersrcFactor
numberdstFactor
Returns
nil
setIndexBatchSize

Set the index batch size. When a prop or deck is drawing, the index is divided by the material batch's index batch size to get the material index. In this way sets of deck indices may be assigned to material indices. For example, an index batch size of 256 for a set of 4 materials would distribute 1024 deck indices across materials 1 though 4. An index batch size of 1 would create a 1 to 1 mapping between deck indices and materials.


function setIndexBatchSize ( MOAIMaterialBatch self [, number indexBatchSize ] )

Parameters
MOAIMaterialBatchself
numberindexBatchSize Optional. Default value is 1.
Returns
nil