FORGE. ButtonSkin

new ButtonSkin(nameopt, statesopt)

This class describe a button skin.
Parameters:
Name Type Attributes Description
name string <optional>
The name of this button skin.
states Object <optional>
An object that describe the different states.
Source:

Extends

Members

(static, constant) DEFAULT_STATE :ButtonSkinStateConfig

This is the default Skin
Type:
  • ButtonSkinStateConfig
Source:

(static, constant) DEFAULT_STATE_IMAGE :ImageConfig

This is the empty Skin state for image
Type:
  • ImageConfig
Source:

(static, constant) DEFAULT_STATE_LABEL :TextFieldConfig

This is the empty Skin state for label
Type:
  • TextFieldConfig
Source:

(static, constant) EMPTY_STATE :ButtonSkinStateConfig

This is the empty Skin state
Type:
  • ButtonSkinStateConfig
Source:

(static, constant) EMPTY_STATE_IMAGE :ImageConfig

This is the empty Skin state for image
Type:
  • ImageConfig
Source:

(static, constant) EMPTY_STATE_LABEL :TextFieldConfig

This is the empty Skin state for label
Type:
  • TextFieldConfig
Source:

(readonly) alive :boolean

Get the alive flag value of the object.
Type:
  • boolean
Inherited From:
Source:

(readonly) className :string

Get the class name of the object.
Type:
  • string
Inherited From:
Source:

data :*

Get and set any custom data you want to associate to this object.
Type:
  • *
Inherited From:
Source:

debug :boolean

Get and set the debug flag.
Type:
  • boolean
Inherited From:
Source:

default :ButtonSkinStateConfig

Get and set the default state of this skin.
Type:
  • ButtonSkinStateConfig
Source:

down :ButtonSkinStateConfig

Get and set the "down" state of this skin.
Type:
  • ButtonSkinStateConfig
Source:

name :string

Get the name of this skin.
Type:
  • string
Source:

(readonly) onDestroy :FORGE.EventDispatcher

Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
Inherited From:
Source:

out :ButtonSkinStateConfig

Get and set the "out" state of this skin.
Type:
  • ButtonSkinStateConfig
Source:

over :ButtonSkinStateConfig

Get and set the "over" state of this skin.
Type:
  • ButtonSkinStateConfig
Source:

(readonly) tags :Array

Get the tags associated to this object.
Type:
  • Array
Inherited From:
Source:

(readonly) uid :string

Get the uid of the object.
Type:
  • string
Inherited From:
Source:

warning :boolean

Get and set the warning flag.
Type:
  • boolean
Inherited From:
Source:

Methods

(static) isValid(skin) → {boolean}

Static method to validate a FORGE.ButtonSkin
Parameters:
Name Type Description
skin FORGE.ButtonSkin
Source:
Returns:
Returns true if the button skin is valid.
Type
boolean

destroy()

Basic destroy method, prevent double destroy, change the alive flag.
Inherited From:
Source:

getProperty(property, state) → {*}

Get a property of a specified state.
Parameters:
Name Type Description
property string The property name you want to get (eg: "borderColor")
state string For which state you want the property ? (out, ouver or down)
Source:
Returns:
Returns the property you asked for, if the property doesn't exist on the requested state, this will return a default value.
Type
*

hasImage(state) → {boolean}

Know if a skin state has an image?
Parameters:
Name Type Description
state string For which state you want to know if there is an image ? (out, ouver or down)
Source:
Returns:
Returns true if the specified state has an image
Type
boolean

hasLabel(state) → {boolean}

Know if a skin state has a label?
Parameters:
Name Type Description
state string For which state you want to know if there is a label ? (out, ouver or down)
Source:
Returns:
Returns true if the specified state has a label
Type
boolean

log(value)

Basic log method, log a string in the console if debug is enabled.
Parameters:
Name Type Description
value * The value you want to log in the console.
Inherited From:
Source:

setDefaultFromState(name)

Set the default skin from a declared state, by default the default skin state will be "out".
Parameters:
Name Type Description
name string The name of the state that you want to be the default one.
Source:

warn(valuenullable)

Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name Type Attributes Description
value string | Object <nullable>
The value you want to warn in the console.
Inherited From:
Source:

FORGE. ButtonSkin

Members
Methods