Class R.text.AbstractTextRenderer
Extends
R.components.Base.
Abstract class that provides the basic interface for all
text render objects used by the R.text.TextRenderer.
Defined in: abstracttextrenderer.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.text.AbstractTextRenderer(componentName, priority)
|
Field Attributes | Field Name and Description |
---|---|
Align text with the center of the string at the point specified
|
|
Align text with the left edge of the string at the point specified.
|
|
Align text with the right edge of the string at the point specified
|
- Fields borrowed from class R.components.Base:
- TYPE_COLLIDER, TYPE_INPUT, TYPE_LOGIC, TYPE_RENDERING, TYPE_TRANSFORM
Method Attributes | Method Name and Description |
---|---|
Get the class name of this object
|
|
getColor()
Get the color of the text to render.
|
|
Get the space between lines in multi-line text.
|
|
getSize()
Get the scaling of the text
|
|
getText()
Get the text being rendered
|
|
Get the alignment of the text.
|
|
Get the font of the text to be rendered
|
|
Get the style of the text for the renderer.
|
|
Get the weight of the text to render.
|
|
isNative()
Return true if the text renderer is native to the context.
|
|
release()
Releases the object back into the object pool.
|
|
setColor(color)
Set the color of the text to render.
|
|
setLineSpacing(lineSpacing)
Set the line spacing between lines of text in a multi-line text string.
|
|
setSize(size)
Set the scaling of the text
|
|
setText(text)
Set the text to be rendered
|
|
setTextAlignment(alignment)
Set the alignment of the text.
|
|
setTextFont(font)
Set the font of the text to be renderer
|
|
setTextStyle(style)
Set the style of the text, usually italics or normal, for the text renderer.
|
|
setTextWeight(weight)
Set the weight of the text to render.
|
- Methods borrowed from class R.components.Base:
- execute, getGameObject, getHostObject, getPriority, getType, getTypeString, setGameObject, setHostObject, setPriority
- Methods borrowed from class R.engine.BaseObject:
- addEvent, addEvents, destroy, getElement, jQ, removeEvent, setElement, triggerEvent, update
- Methods borrowed from class R.engine.PooledObject:
- clearObjectDataModel, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toString, toXML
Class Detail
R.text.AbstractTextRenderer(componentName, priority)
- Parameters:
- componentName
- {String} The name of the renderer
- priority
- {Number} The priority of the rendering order. Default: 0.1
Field Detail
{Number}
ALIGN_CENTER
Align text with the center of the string at the point specified
{Number}
ALIGN_LEFT
Align text with the left edge of the string at the point specified.
{Number}
ALIGN_RIGHT
Align text with the right edge of the string at the point specified
Method Detail
{String}
getClassName()
Get the class name of this object
- Returns:
- {String} The string "R.text.AbstractTextRenderer"
{String}
getColor()
Get the color of the text to render.
- Returns:
- {String} The text color
{Number}
getLineSpacing()
Get the space between lines in multi-line text.
- Returns:
- {Number}
{Number}
getSize()
Get the scaling of the text
- Returns:
- {Number}
{String}
getText()
Get the text being rendered
- Returns:
- {String} The text this renderer will draw
{Object}
getTextAlignment()
Get the alignment of the text.
- Returns:
- {Object} The alignment of the text renderer
{String}
getTextFont()
Get the font of the text to be rendered
- Returns:
- {String} The font name
{Object}
getTextStyle()
Get the style of the text for the renderer.
- Returns:
- {Object} The style of the text
{Number}
getTextWeight()
Get the weight of the text to render.
- Returns:
- {Number} The weight of the text
{Boolean}
isNative()
Return true if the text renderer is native to the context.
- Returns:
- {Boolean}
release()
Releases the object back into the object pool. See R.engine.PooledObject#release
for more information.
setColor(color)
Set the color of the text to render.
- Parameters:
- color
- {String} The color of the text to render
setLineSpacing(lineSpacing)
Set the line spacing between lines of text in a multi-line text string.
Multi-line text is separated by the carriage return (0xA).
- Parameters:
- lineSpacing
- {Number} Line spacing (default: 7)
setSize(size)
Set the scaling of the text
- Parameters:
- size
- {Number}
setText(text)
Set the text to be rendered
- Parameters:
- text
- {String} The text to render
setTextAlignment(alignment)
Set the alignment of the text.
- Parameters:
- alignment
- {Object} The alignment for the text renderer
setTextFont(font)
Set the font of the text to be renderer
- Parameters:
- font
- {String} The font name
setTextStyle(style)
Set the style of the text, usually italics or normal, for the text renderer.
- Parameters:
- style
- {Object} The style of the text
setTextWeight(weight)
Set the weight of the text to render. Higher weights
are bolder text.
- Parameters:
- weight
- {Number} The weight of the text.