Text Methods

Text(anchorPoint, textString)
Constructs a text object that displays textString centered at anchorPoint. The text is displayed horizontally.


Example: message = Text(Point(3,4), "Hello!")

setText(string)
Sets the text of the object to string.


Example: message.setText("Goodbye!")

getText()
Returns the current string.


Example: msgString = message.getText()

getAnchor()
Returns a clone of the anchor point.


Example: centerPoint = message.getAnchor()

setFace(family)
Changes the font face to the given family. Possible values are "helvetica", "courier", "times roman", and "arial".


Example: message.setFace("arial")

setSize(point)
Changes the font size to the given point size. Sizes from 5 to 36 points are legal.


Example: message.setSize(18)

setStyle(style)
Changes font to the given style. Possible values are: "normal", "bold", "italic", and "bold italic".


Example: message.setStyle("bold")

setTextColor(color)
Sets the color of the text to color. Note: setFill has the same effect.


Example: message.setTextColor("pink")



zelle 2016-08-26