Class Text
Extends
DisplayObject.
The Text class provides basic methods to draw text onto Stage.
Constructor Attributes | Constructor Name and Description |
---|---|
Text()
Constructor.
|
Field Attributes | Field Name and Description |
---|---|
Indicates the alignment of the text paragraph, default is "start".
|
|
The color of the text, default is "#000".
|
|
The font style for text, default is "12px Arial".
|
|
Indicates the maximum width of the text paragraph.
|
|
A Boolean that indicates whether the text is outline or not, default is false.
|
|
The text string to be displayed.
|
- Fields borrowed from class DisplayObject:
- alpha, height, id, mouseEnabled, name, parent, regX, regY, rotation, scaleX, scaleY, stage, useHandCursor, visible, width, x, y
Method Attributes | Method Name and Description |
---|---|
getWidth(context)
Gets the width of the text.
|
- Methods borrowed from class DisplayObject:
- getCurrentHeight, getCurrentWidth, getRect, getStage, globalToLocal, hitTestObject, hitTestPoint, localToGlobal, localToTarget, onMouseEvent, render, toString
- Methods borrowed from class EventDispatcher:
- addEventListener, dispatchEvent, hasEventListener, removeAllEventListeners, removeEventListener, removeEventListenerByType
Field Detail
align
Indicates the alignment of the text paragraph, default is "start".
color
The color of the text, default is "#000".
font
The font style for text, default is "12px Arial".
maxWidth
Indicates the maximum width of the text paragraph.
outline
A Boolean that indicates whether the text is outline or not, default is false.
text
The text string to be displayed.
Method Detail
getWidth(context)
Gets the width of the text.
- Parameters:
- context