class TextCallout
package feathers.controls
extends Callout › FeathersControl › MeasureSprite › ValidatingSprite
implements ITextControl
A special type of Callout
designed to display text only.
In the following example, a text callout is shown when a Button
is
triggered:
function button_triggerHandler(event:TriggerEvent):Void
{
var button = cast(event.currentTarget, Button);
TextCallout.show("Hello World", button);
}
button.addEventListener(TriggerEvent.TRIGGER, button_triggerHandler);
1.0.0
.See also:
Static methods
staticshow(text:String, origin:DisplayObject, ?supportedPositions:RelativePositions, modal:Bool = true):TextCallout
Creates a text callout, and then positions and sizes it automatically based based on an origin component and an optional set of positions.
In the following example, a text callout is shown when a Button
is
triggered:
function button_triggerHandler(event:TriggerEvent):Void
{
var button = cast(event.currentTarget, Button);
TextCallout.show("Hello World", button);
}
button.addEventListener(TriggerEvent.TRIGGER, button_triggerHandler);
1.0.0
.Constructor
new()
Creates a new TextCallout
object.
In general, a TextCallout
shouldn't be instantiated directly with the
constructor. Instead, use the static function TextCallout.show()
to
create a TextCallout
, as this often requires less pop-up management
code.
1.0.0
.See also:
Variables
disabledTextFormat:TextFormat
The font styles used to render the text callout's text when the text callout is disabled.
In the following example, the text callout's disabled text formatting is customized:
callout.enabled = false;
callout.disabledTextFormat = new TextFormat("Helvetica", 20, 0xee0000);
1.0.0
.See also:
embedFonts:Bool
Determines if an embedded font is used or not.
In the following example, the callout uses embedded fonts:
callout.embedFonts = true;
1.0.0
.See also:
text:String
The text displayed by the text callout.
The following example creates a text callout and changes its text:
var callout = TextCallout.show("Good morning!", origin);
callout.text = "Good afternoon!";
1.0.0
.See also:
textFormat:TextFormat
The font styles used to render the text callout's text.
In the following example, the text callout's formatting is customized:
callout.textFormat = new TextFormat("Helvetica", 20, 0xcc0000);
1.0.0
.See also: