class Label
package feathers.controls
extends FeathersControl › MeasureSprite › ValidatingSprite
implements ITextControl
Displays text with an optional background.
The following example creates a label and gives it text:
var label = new Label();
label.text = "Hello World";
this.addChild(label);
1.0.0
.See:
Constructor
Variables
backgroundSkin:DisplayObject = null
The default background skin to display behind the label's text.
The following example passes a bitmap for the label to use as a background skin:
label.backgroundSkin = new Bitmap(bitmapData);
1.0.0
.See:
disabledBackgroundSkin:DisplayObject = null
A background skin to display behind the label's text when the label is disabled.
The following example gives the label a disabled background skin:
label.disabledBackgroundSkin = new Bitmap(bitmapData);
label.enabled = false;
1.0.0
.See:
disabledTextFormat:TextFormat = null
The font styles used to render the label's text when the label is disabled.
In the following example, the label's disabled text formatting is customized:
label.enabled = false;
label.disabledTextFormat = new TextFormat("Helvetica", 20, 0xee0000);
1.0.0
.See:
paddingBottom:Float = 0.0
The minimum space, in pixels, between the button's bottom edge and the button's content.
In the following example, the button's bottom padding is set to 20 pixels:
button.paddingBottom = 20.0;
1.0.0
.paddingLeft:Float = 0.0
The minimum space, in pixels, between the button's left edge and the button's content.
In the following example, the button's left padding is set to 20 pixels:
button.paddingLeft = 20.0;
1.0.0
.paddingRight:Float = 0.0
The minimum space, in pixels, between the button's right edge and the button's content.
In the following example, the button's right padding is set to 20 pixels:
button.paddingRight = 20.0;
1.0.0
.paddingTop:Float = 0.0
The minimum space, in pixels, between the button's top edge and the button's content.
In the following example, the button's top padding is set to 20 pixels:
button.paddingTop = 20.0;
1.0.0
.text:String = ""
The text displayed by the label.
The following example sets the label's text:
label.text = "Good afternoon!";
1.0.0
.See:
textFormat:TextFormat = null
The font styles used to render the label's text.
In the following example, the label's text formatting is customized:
label.textFormat = new TextFormat("Helvetica", 20, 0xcc0000);
1.0.0
.See:
verticalAlign:VerticalAlign = MIDDLE
How the content is positioned vertically (along the y-axis) within the button.
The following example aligns the button's content to the top:
button.verticalAlign = TOP;
Note: The VerticalAlign.JUSTIFY
constant is not supported by this
component.
See:
wordWrap:Bool = false
Determines if the text is displayed on a single line, or if it wraps.
In the following example, the label's text wraps at 150 pixels:
label.width = 150.0;
label.wordWrap = true;
1.0.0
.Static variables
staticread onlyVARIANT_DETAIL:String = "detail"
A variant used to style the label using a smaller text format for details. Variants allow themes to provide an assortment of different appearances for the same type of UI component.
The following example uses this variant:
var label = new Label();
label.variant = Label.VARIANT_DETAIL;
1.0.0
.See:
staticread onlyVARIANT_HEADING:String = "heading"
A variant used to style the label using a Larger text format for headings. Variants allow themes to provide an assortment of different appearances for the same type of UI component.
The following example uses this variant:
var label = new Label();
label.variant = Label.VARIANT_HEADING;
1.0.0
.See: