| Package | feathers.text |
| Class | public class FontStylesSet |
| Inheritance | FontStylesSet starling.events.EventDispatcher |
| Product Version : | Feathers 3.1.0 |
ITextRenderer implementations to pass
around sets of TextFormat objects for a component's
different states.
A custom component that uses one or more text renderers is expected to
provide user-facing APIs to set its font styles using
separate TextFormat instances. The combined set of these
formats should be stored in a FontStylesSet that can be
passed into the text renderer.
See also
| Property | Defined By | ||
|---|---|---|---|
| disabledFormat : TextFormat
The font styles used to display the text when the component is
disabled. | FontStylesSet | ||
| format : TextFormat
The default font format used to display the text. | FontStylesSet | ||
| selectedFormat : TextFormat
The font styles used to display the text when the component is
selected. | FontStylesSet | ||
| Method | Defined By | ||
|---|---|---|---|
Constructor. | FontStylesSet | ||
dispose():void
Cleans up all TextFormat objects. | FontStylesSet | ||
getFormatForState(state:String):TextFormat
Returns the TextFormat for a specific state, or
null if the TextFormat has not been set
for that state. | FontStylesSet | ||
getTextFormatForTarget(target:IFeathersControl):TextFormat
Chooses the appropriate TextFormat to use based on the
state of the text renderer passed in. | FontStylesSet | ||
setFormatForState(state:String, value:TextFormat):void
Sets the TextFormat for a specific state. | FontStylesSet | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when a new starling.text.TextFormat is passed in or when one of the existing TextFormat objects is modified. | FontStylesSet | |||
| disabledFormat | property |
disabledFormat:TextFormat
The font styles used to display the text when the component is
disabled. If null, the value of the format
property will typically be used.
public function get disabledFormat():TextFormat public function set disabledFormat(value:TextFormat):voidSee also
| format | property |
format:TextFormatThe default font format used to display the text.
public function get format():TextFormat public function set format(value:TextFormat):voidSee also
| selectedFormat | property |
selectedFormat:TextFormat
The font styles used to display the text when the component is
selected. If null, the value of the format
property will typically be used.
public function get selectedFormat():TextFormat public function set selectedFormat(value:TextFormat):voidSee also
| FontStylesSet | () | Constructor |
public function FontStylesSet()Constructor.
| dispose | () | method |
public function dispose():voidCleans up all TextFormat objects.
| getFormatForState | () | method |
public function getFormatForState(state:String):TextFormat
Returns the TextFormat for a specific state, or
null if the TextFormat has not been set
for that state.
Parameters
state:String |
TextFormat |
See also
| getTextFormatForTarget | () | method |
public function getTextFormatForTarget(target:IFeathersControl):TextFormat
Chooses the appropriate TextFormat to use based on the
state of the text renderer passed in. If the text renderer has a
stateContext, the state of the stateContext
takes precedent.
Parameters
target:IFeathersControl |
TextFormat |
See also
| setFormatForState | () | method |
public function setFormatForState(state:String, value:TextFormat):void
Sets the TextFormat for a specific state.
Pass in null to clear the format for the state.
Parameters
state:String | |
value:TextFormat |
See also
| change | Event |
starling.events.Eventstarling.events.Event.CHANGE
Dispatched when a new starling.text.TextFormat is passed in
or when one of the existing TextFormat objects is modified.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
data | null |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |