Text


Inheritance Text View Module hilo/view/Text Requires hilo/core/Class, hilo/core/Hilo, hilo/view/View, hilo/view/CacheMixin Source Text.js
Text class provide basic text-display function, use DOMElement for complex text-display.


Properties

Show Inherited Properties
Property Defined
color:String
Color of the text.
Text
font:String
Text's CSS font style, readonly! Use setFont function to set text font.
Text
lineSpacing:Number
The spacing between lines.
Text
maxWidth:Number
The max length of the text, default value is 200.
Text
outline:Boolean
Draw the outline of the text or fill the text.
Text
text:String
Text to display.
Text
textAlign:String
Horizontal alignment way of the text.
Text
textHeight:Number
Height of the text, readonly! Works only on canvas mode.
Text
textVAlign:String
Vertical alignment way of the text.
Text
textWidth:Number
Width of the text, readonly! Works only on canvas mode.
Text

Methods

Show Inherited Methods
Method Defined
Text(properties:Object)
Constructor
Text
cache(forceUpdate:Boolean)
Cache the view.
Text
setCacheDirty(dirty:Boolean)
set the cache state diry.
Text
setFont(font:String):Text
Set text CSS font style.
Text
Update the cache.
Text
measureFontHeight(font:String):Number
static Measure the line height of the assigned text font style.
Text

Property Detail

color:String
Color of the text.
font:String
Text's CSS font style, readonly! Use setFont function to set text font.
lineSpacing:Number
The spacing between lines. Measured in px, default value is 0.
maxWidth:Number
The max length of the text, default value is 200.
outline:Boolean
Draw the outline of the text or fill the text.
text:String
Text to display.
textAlign:String
Horizontal alignment way of the text. May be one of the following value:'start', 'end', 'left', 'right', and 'center'. Note:Need to specify the width property of the text to take effect
textHeight:Number
Height of the text, readonly! Works only on canvas mode.
textVAlign:String
Vertical alignment way of the text. May be one of the following value:'top', 'middle', 'bottom'. Note:Need to specify the height property of the text to take effect.
textWidth:Number
Width of the text, readonly! Works only on canvas mode.

Constructor

Text(properties:Object)
parameters
properties:Object — Properties parameters for the object. Includes all writable properties.

Method Detail

cache(forceUpdate:Boolean)
Cache the view.
parameters
forceUpdate:Boolean — is force update cache.
[Static] measureFontHeight(font:String):Number
Measure the line height of the assigned text font style.
parameters
font:String — Font style to measure.
return
Number — Return line height of the assigned font style.
setCacheDirty(dirty:Boolean)
set the cache state diry.
parameters
dirty:Boolean — is cache dirty
setFont(font:String):Text
Set text CSS font style.
parameters
font:String — Text CSS font style to set.
return
Text — the Text object, chained call supported.
updateCache()
Update the cache.