Packagefeathers.text
Classpublic class FontStylesSet
InheritanceFontStylesSet Inheritance starling.events.EventDispatcher

Product Version : Feathers 3.1.0

Used internally by 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

feathers.core.ITextRenderer
starling.text.TextFormat


Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
  
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
Events
 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
Property Detail
disabledFormatproperty
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.


Implementation
    public function get disabledFormat():TextFormat
    public function set disabledFormat(value:TextFormat):void

See also

formatproperty 
format:TextFormat

The default font format used to display the text.


Implementation
    public function get format():TextFormat
    public function set format(value:TextFormat):void

See also

selectedFormatproperty 
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.


Implementation
    public function get selectedFormat():TextFormat
    public function set selectedFormat(value:TextFormat):void

See also

Constructor Detail
FontStylesSet()Constructor
public function FontStylesSet()

Constructor.

Method Detail
dispose()method
public function dispose():void

Cleans 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

Returns
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

Returns
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

Event Detail
change Event
Event Object Type: starling.events.Event
Event.type property = starling.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:

PropertyValue
bubblesfalse
currentTargetThe 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.
datanull
targetThe 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.