import DisplayObject from "../display/DisplayObject"; declare namespace openfl.text { /** * This class represents StaticText objects on the display list. You cannot * create a StaticText object using Haxe code. Only the authoring tool can * create a StaticText object. An attempt to create a new StaticText object * generates an `ArgumentError`. * To create a reference to an existing static text field in Haxe code, * you can iterate over the items in the display list. For example, the * following snippet checks to see if the display list contains a static text * field and assigns the field to a variable: * * ```haxe * for (i in 0...numChildren) { * var displayitem = getChildAt(i); * if ((displayitem is StaticText)) { * trace("a static text field is item " + i + " on the display list"); * var myFieldLabel:StaticText = cast displayitem; * trace("and contains the text: " + myFieldLabel.text); * } * } * ``` * * @see [Working with static text](https://books.openfl.org/openfl-developers-guide/using-the-textfield-class/working-with-static-text.html) * @see `openfl.text.TextField` * */ export class StaticText extends DisplayObject { protected constructor(); /** * Returns the current text of the static text field. The authoring tool * may export multiple text field objects comprising the complete text. * For example, for vertical text, the authoring tool will create one * text field per character. * */ text: string; } } export default openfl.text.StaticText;