SmartDisplayObjectStateValueSelector
public class
feathers.skins.SmartDisplayObjectStateValueSelector
Description
Values for each state are textures or colors, and the manager attempts to reuse the existing display object that is passed in to getValueForState() as the old value, if possible. Supports Image and Texture, Scale3Image and Scale3Textures, Scale9Image and Scale9Textures, or Quad and uint (color) value.
Additional value type handlers may be added, or the default type handlers may be replaced.
API overview
Constructor
SmartDisplayObjectStateValueSelector
()
Constructor.
Attributes
Public attributes
| displayObjectProperties: Dictionary.<String, Object> |
Optional properties to set on the Scale9Image instance |
Functions
Public functions
| clearValueTypeHandler ( type: Type ): Void |
Clears a value type handler |
| getValueTypeHandler ( type: Type , handler: Function ): Function |
Returns the function that handles updating a value of a specific type |
| scale3TextureValueTypeHandler ( value: Scale3Textures , oldDisplayObject: DisplayObject = null ): DisplayObject |
static The value type handler for type |
| scale9TextureValueTypeHandler ( value: Scale9Textures , oldDisplayObject: DisplayObject = null ): DisplayObject |
static The value type handler for type |
| setValueTypeHandler ( type: Type , handler: Function ): Void |
Sets a function to handle updating a value of a specific type |
| textureValueTypeHandler ( value: Texture , oldDisplayObject: DisplayObject = null ): DisplayObject |
static The value type handler for type |
| uintValueTypeHandler ( value: Number , oldDisplayObject: DisplayObject = null ): DisplayObject |
static The value type handler for type |
Constructor
SmartDisplayObjectStateValueSelector ()
Constructor.
Attributes
defaultSelectedValue: Object
Inherited from StateWithToggleValueSelector
If the target is a selected IToggle instance, and if there is no value for the specified state, a default value may be used as a fallback (with a higher priority than the regular default fallback).
See also:
feathers.core.IToggle
defaultValue: Object
Inherited from StateWithToggleValueSelector
If there is no value for the specified state, a default value can be used as a fallback.
displayObjectProperties: Dictionary.<String, Object>
Optional properties to set on the Scale9Image instance.
See also:
feathers.display.Scale9Image
Functions
clearValueForState
(
state: Object
,
isSelected: Boolean
= false
): Object
Inherited from StateWithToggleValueSelector
Clears the value stored for a specific state.
Parameters
| state: Object | |
| isSelected: Boolean = false |
getFullTypeName
(): String
Inherited from Object
native
Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.
Returns
| String | fully qualified type name of the Object. |
getType
(): Type
Inherited from Object
native
Gets the Type that describes the Object.
Returns
| Type | The Type that describes the object. |
getTypeName
(): String
Inherited from Object
native
Gets the type name of the Object.
Returns
| String | type name of the Object. |
getValueForState
(
state: Object
,
isSelected: Boolean
= false
): Object
Inherited from StateWithToggleValueSelector
Returns the value stored for a specific state.
Parameters
| state: Object | |
| isSelected: Boolean = false |
getValueTypeHandler ( type: Type , handler: Function ): Function
Returns the function that handles updating a value of a specific type.
Parameters
| type: Type | |
| handler: Function |
scale3TextureValueTypeHandler ( value: Scale3Textures , oldDisplayObject: DisplayObject = null ): DisplayObject
static
The value type handler for type feathers.textures.Scale3Textures.
See also:
feathers.textures.Scale3Textures
Parameters
| value: Scale3Textures | |
| oldDisplayObject: DisplayObject = null |
scale9TextureValueTypeHandler ( value: Scale9Textures , oldDisplayObject: DisplayObject = null ): DisplayObject
static
The value type handler for type feathers.textures.Scale9Textures.
See also:
feathers.textures.Scale9Textures
Parameters
| value: Scale9Textures | |
| oldDisplayObject: DisplayObject = null |
setValueForState
(
value: Object
,
state: Object
,
isSelected: Boolean
= false
): Void
Inherited from StateWithToggleValueSelector
Stores a value for a specified state to be returned from getValueForState().
Parameters
| value: Object | |
| state: Object | |
| isSelected: Boolean = false |
setValueTypeHandler ( type: Type , handler: Function ): Void
Sets a function to handle updating a value of a specific type. The function must have the following signature:
function(value:Object, oldDisplayObject:DisplayObject = null):DisplayObject
The oldDisplayObject is optional, and it may be of
a type that is different than what the function will return. If the
types do not match, the function should create a new object instead
of reusing the old display object.
Parameters
| type: Type | |
| handler: Function |
textureValueTypeHandler ( value: Texture , oldDisplayObject: DisplayObject = null ): DisplayObject
static
The value type handler for type loom2d.textures.Texture.
See also:
loom2d.textures.Texture
Parameters
| value: Texture | |
| oldDisplayObject: DisplayObject = null |
toString
(): String
Inherited from Object
native
Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().
Returns
| String | String that described the Object. |
uintValueTypeHandler ( value: Number , oldDisplayObject: DisplayObject = null ): DisplayObject
static
The value type handler for type uint (a color to display
by a quad).
Parameters
| value: Number | |
| oldDisplayObject: DisplayObject = null |
updateValue
(
target: Object
,
state: Object
,
oldValue: Object
= null
): Object
Inherited from StateWithToggleValueSelector
Returns the value stored for a specific state. May generate a value, if none is present.
Parameters
| target: Object | The object receiving the stored value. The manager may query properties on the target to customize the returned value. |
| state: Object | The current state. |
| oldValue: Object = null | The previous value. May be reused for the new value. |