Text
Extends :: Obj
A class that defines a text object with a position vector and style properties.
This class must be accessed through the iio package.
Constructors
These functions are used to instantiate new instances of the Text class. Constructor functions must be preceded by the new keyword.
Graphics Properties
The following properties can are attached by the iio Graphics Engine. Note that these properties are 'undefined' by default, so you must define them with their set functions or set their values directly.
Kinematics Properties
The following properties can are attached by the iio Kinematics Engine. Note that these properties are 'undefined' by default, so you must define them with their set functions or set their values directly.
Properties
The new data added by the Text class. These properties will always exist for an instantiated Text object.
.text :: String
- the text of this text object.
//get a text object's text var message = text.text; //set a text object's message directly text.text = 'new message';
.font :: String
- the font and font size of this text object.
//get a text object's font var f = text.font; //set font directly text.font = '30px Arial';
.textAlign :: String
- the alignment of this text object. Possible values are 'center', 'right', and 'left'. The default value is 'left'.
//get a text object's textAlign var f = text.textAlign; //set the text aligment text.textAlign = 'center';
Kinematics Functions
The following functions can are attached by the iio Kinematics Engine. Note that you must call the enableKinematics function before you can utilize any of these functions.
Functions
These functions are added by the Text class, and available to all instantiated Text objects.
.clone()
:: Returns Text
- returns a new Text object with the same properties as this one. Makes a hard copy of the object.
//clone a text object var t2 = text.clone();
.setText( String text )
:: Returns this
- sets the text of this text object to the given message.
//change the text
text.setText('new text');