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

Function List

getColor
 
getFont
 
getScale
 
getSize
 
setColor
 
setFont
 
setShader
 
setPadding
 
setScale
 
setSize
 
- Function List inherited from MOAINode
clearAttrLink
 
clearNodeLink
 
forceUpdate
 
getAttr
 
getAttrLink
 
getNodeState
 
moveAttr
 
scheduleUpdate
 
seekAttr
 
setAttrLink
 
setAttr
 
setNodeLink
 
- Function List inherited from MOAIInstanceEventSource
getListener
 
setListener
 

Function Documentation

getColor

Gets the color of the style.


function getColor ( MOAITextStyle self )

Parameters
MOAITextStyleself
Returns
number r, number g, number b, number a
getFont

Gets the font of the style.


function getFont ( MOAITextStyle self )

Parameters
MOAITextStyleself
Returns
MOAIFont font
getScale

Gets the scale of the style.


function getScale ( MOAITextStyle self )

Parameters
MOAITextStyleself
Returns
number scale
getSize

Gets the size of the style.


function getSize ( MOAITextStyle self )

Parameters
MOAITextStyleself
Returns
number size
setColor

Initialize the style's color.


function setColor ( MOAITextStyle self, number r, number g, number b [, number a ] )

Parameters
MOAITextStyleself
numberr Default value is 0.
numberg Default value is 0.
numberb Default value is 0.
numbera Optional. Default value is 1.
Returns
nil
setFont

Sets or clears the style's font.


function setFont ( MOAITextStyle self [, MOAIFont font ] )

Parameters
MOAITextStyleself
MOAIFontfont Optional. Default value is nil.
Returns
nil
setPadding

Add padding to glyphs during layout. Padding does not affect placement of glyphs. Padding only causes more of the glyph and its underlying texture to be shown.


function setPadding ( MOAITextStyle self, number hPad, number vPad )

Parameters
MOAITextStyleself
numberhPad glyph xMin -= hPad * 0.5, glyph xMax += hPad * 0.5
numbervPad glyph yMin -= vPad * 0.5, glyph yMax += vPad * 0.5
Returns
nil
Note

function setPadding ( MOAITextStyle self, xMinP glyph, yMinP glyph, xMaxP glyph, yMaxP glyph )

Parameters
MOAITextStyleself
xMinPglyph xMin -= xMinP
yMinPglyph yMin -= yMinP
xMaxPglyph xMax += xMaxP
yMaxPglyph yMax += yMaxP
Returns
nil
Note
setScale

Sets the scale of the style. The scale is applied to any glyphs drawn using the style after the glyph set has been selected by size.


function setScale ( MOAITextStyle self [, number scale ] )

Parameters
MOAITextStyleself
numberscale Optional. Default value is 1.
Returns
nil
setShader

Sets the shader for the text style to use.


function setShader ( MOAITextStyle self [, variant shader ] )

Parameters
MOAITextStyleself
variantshader Optional. Shader or shader preset.
Returns
MOAIShader shader
setSize

Sets or clears the style's size.


function setSize ( MOAITextStyle self, number points [, number dpi ] )

Parameters
MOAITextStyleself
numberpoints The point size to be used by the style.
numberdpi Optional. The device DPI (dots per inch of device screen). Default value is 72 (points same as pixels).
Returns
nil