Class: Button

lime.Button

new lime.Button(opt_upstate, opt_downstate)

Simple button element
Parameters:
Name Type Description
opt_upstate lime.Sprite Object shown on normal state.
opt_downstate lime.Sprite Object show when button is pressed.
Source:

Extends

Summary

Methods
getState() → {lime.Button.State}
Returns current state of the button
setDownState(downstate) → {lime.Button}
Sets the sprite used as button down state. Down state is hown if mouse is down on button or finger is touching the button.
setState(value) → {lime.Button}
Sets the state of the button. Also fires events is state changes.
setUpState(upstate) → {lime.Button}
Sets the sprite used as button up state
Inherited
lime.Layer.addEventListenerlime.Layer.addTransitionlime.Layer.appendChildlime.Layer.calcRelativeQualitylime.Layer.clearTransitionlime.Layer.createDomElementlime.Layer.getAnchorPointlime.Layer.getAutoResizelime.Layer.getBoundingBoxlime.Layer.getChildAtlime.Layer.getChildIndexlime.Layer.getCSS3DTransformsAllowedlime.Layer.getDeepestDomElementlime.Layer.getDeepestParentWithDomlime.Layer.getDirectorlime.Layer.getDirtylime.Layer.getFramelime.Layer.getHiddenlime.Layer.getMasklime.Layer.getNumberOfChildrenlime.Layer.getOpacitylime.Layer.getParentlime.Layer.getParentStack_lime.Layer.getPositionlime.Layer.getQualitylime.Layer.getRelativeQualitylime.Layer.getRotationlime.Layer.getScalelime.Layer.getScenelime.Layer.getSizelime.Layer.hitTestlime.Layer.localToNodelime.Layer.localToParentlime.Layer.localToScreenlime.Layer.measureContentslime.Layer.needsDomElementlime.Layer.parentToLocallime.Layer.removeAllChildrenlime.Layer.removeChildlime.Layer.removeChildAtlime.Layer.removeDomElementlime.Layer.removeEventListenerlime.Layer.runActionlime.Layer.screenToLocallime.Layer.setAllow3DCSSTransformslime.Layer.setAnchorPointlime.Layer.setAutoResizelime.Layer.setChildIndexlime.Layer.setDirtylime.Layer.setHiddenlime.Layer.setMasklime.Layer.setOpacitylime.Layer.setPositionlime.Layer.setQualitylime.Layer.setRendererlime.Layer.setRotationlime.Layer.setScalelime.Layer.setSizelime.Layer.updatelime.Layer.updateDomElementlime.Layer.updateLayoutlime.Layer.wasAddedToTreelime.Layer.wasRemovedFromTree

Members

<static> Event :string

Button event names
Properties:
Name Type Default Description
UP string up
DOWN string down
CLICK string click
Source:

<static> State :number

Button states
Properties:
Name Type Default Description
UP number 0
DOWN number 1
Source:

Methods

getState() → {lime.Button.State}

Returns current state of the button
Source:
Returns:
current state.
Type
lime.Button.State

setDownState(downstate) → {lime.Button}

Sets the sprite used as button down state. Down state is hown if mouse is down on button or finger is touching the button.
Parameters:
Name Type Description
downstate lime.Sprite Object shown when button is pressed.
Source:
Returns:
object itself.
Type
lime.Button

setState(value) → {lime.Button}

Sets the state of the button. Also fires events is state changes.
Parameters:
Name Type Description
value lime.Button.State State to be set.
Source:
Returns:
object itself.
Type
lime.Button

setUpState(upstate) → {lime.Button}

Sets the sprite used as button up state
Parameters:
Name Type Description
upstate lime.Sprite Object shown on normal state.
Source:
Returns:
object itself.
Type
lime.Button