Package | feathers.text |
Class | public class FontStylesSet |
Inheritance | FontStylesSet ![]() ![]() |
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 | ||
![]() | addEventListener(type:String, listener:Function):void Registers an event listener at a certain object. | EventDispatcher | |
![]() | dispatchEvent(event:Event):void Dispatches an event to all objects that have registered listeners for its type. | EventDispatcher | |
![]() | dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void Dispatches an event with the given parameters to all objects that have registered
listeners for the given type. | EventDispatcher | |
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 | ||
![]() | hasEventListener(type:String, listener:Function = null):Boolean If called with one argument, figures out if there are any listeners registered for
the given event type. | EventDispatcher | |
![]() | removeEventListener(type:String, listener:Function):void Removes an event listener from the object. | EventDispatcher | |
![]() | removeEventListeners(type:String = null):void Removes all event listeners with a certain type, or all of them if type is null. | EventDispatcher | |
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):void
See also
format | property |
format:TextFormat
The default font format used to display the text.
public function get format():TextFormat
public function set format(value:TextFormat):void
See 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):void
See also
FontStylesSet | () | Constructor |
public function FontStylesSet()
Constructor.
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 |
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.Event
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:
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. |