Class Text
Extends
SceneContent.
Text Draws some text on the Stage. This implementation uses the WHATWG
specifications and is only available in certain browsers.
Defined in: Text.js.
// Simple example Text({ x: 10, y: 50, text: "HTML 5 Rocks!" })
// Centering text. Text({ x: 50, y: 50, text: "HTML 5 Rocks!", align: Text.Align.center })
// Making it cooler. Text({ x: 50, y: 50, text: "~CooL~", align: Text.Align.center, fill: "#DFDFFF", stroke: "#413FFF", stroke_width: 2, font: Font({ size: "18px", weight: Font.Weights.bold }) })
Constructor Attributes | Constructor Name and Description |
---|---|
Text(_details)
|
- Fields borrowed from class SceneContent:
- details
Method Attributes | Method Name and Description |
---|---|
setText(_text)
Sets the text of this Text object.
|
- Methods borrowed from class SceneContent:
- draw, extend, getBounds, getName, getParent, getScene, getStage, isActive, isVisible, load, loadBase, moveBy, moveTo, setActive, setSize, setVisible, update, updateBase
Class Detail
Text(_details)
- Parameters:
- {Object} _details
- An JSON object containing the following properties:
Property Required Default align no start baseline no alphabetic fill no #000000 font no Font({family: ["Tahoma", "Ariel"]}) stroke no transparent stroke_width no 1 text no ""
- Requires:
- Firefox 3.5.x, Safari, or Google Chrome
- See:
- WHATWG Canvas and Text
Method Detail
setText(_text)
Sets the text of this Text object.
- Parameters:
- {String} _text
- The text to display.