Moai SDK  2.0
MOAITextureBase Class Reference
+ Inheritance diagram for MOAITextureBase:

Function List

getSize
 
release
 
setDebugName
 
setFilter
 
setWrap
 

Additional Inherited Members

- Function List inherited from MOAIGfxResource
getAge
 
purge
 
setReloader
 
- Function List inherited from MOAIInstanceEventSource
getListener
 
setListener
 

Detailed Description

Constants
MOAITextureBase.GL_LINEAR
MOAITextureBase.GL_LINEAR_MIPMAP_LINEAR
MOAITextureBase.GL_LINEAR_MIPMAP_NEAREST
MOAITextureBase.GL_NEAREST
MOAITextureBase.GL_NEAREST_MIPMAP_LINEAR
MOAITextureBase.GL_NEAREST_MIPMAP_NEAREST

Function Documentation

getSize

Returns the width and height of the texture's source image. Avoid using the texture width and height to compute UV coordinates from pixels, as this will prevent texture resolution swapping.


function getSize ( MOAITextureBase self )

Parameters
MOAITextureBaseself
Returns
number width, number height
release

Releases any memory associated with the texture.


function release ( MOAITextureBase self )

Parameters
MOAITextureBaseself
Returns
nil
setDebugName

Set a name for the texture to use during memory logging.


function setDebugName ( MOAITextureBase self, string debugName )

Parameters
MOAITextureBaseself
stringdebugName
Returns
nil
setFilter

Set default filtering mode for texture.


function setFilter ( MOAITextureBase self, number min [, number mag ] )

Parameters
MOAITextureBaseself
numbermin One of MOAITextureBase.GL_LINEAR, MOAITextureBase.GL_LINEAR_MIPMAP_LINEAR, MOAITextureBase.GL_LINEAR_MIPMAP_NEAREST, MOAITextureBase.GL_NEAREST, MOAITextureBase.GL_NEAREST_MIPMAP_LINEAR, MOAITextureBase.GL_NEAREST_MIPMAP_NEAREST
numbermag Optional. Defaults to value passed to 'min'.
Returns
nil
setWrap

Set wrapping mode for texture.


function setWrap ( MOAITextureBase self, boolean wrap )

Parameters
MOAITextureBaseself
booleanwrap Texture will wrap if true, clamp if not.
Returns
nil