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:
- button.js, line 12
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.addEventListener,  lime.Layer.addTransition,  lime.Layer.appendChild,  lime.Layer.calcRelativeQuality,  lime.Layer.clearTransition,  lime.Layer.createDomElement,  lime.Layer.getAnchorPoint,  lime.Layer.getAutoResize,  lime.Layer.getBoundingBox,  lime.Layer.getChildAt,  lime.Layer.getChildIndex,  lime.Layer.getCSS3DTransformsAllowed,  lime.Layer.getDeepestDomElement,  lime.Layer.getDeepestParentWithDom,  lime.Layer.getDirector,  lime.Layer.getDirty,  lime.Layer.getFrame,  lime.Layer.getHidden,  lime.Layer.getMask,  lime.Layer.getNumberOfChildren,  lime.Layer.getOpacity,  lime.Layer.getParent,  lime.Layer.getParentStack_,  lime.Layer.getPosition,  lime.Layer.getQuality,  lime.Layer.getRelativeQuality,  lime.Layer.getRotation,  lime.Layer.getScale,  lime.Layer.getScene,  lime.Layer.getSize,  lime.Layer.hitTest,  lime.Layer.localToNode,  lime.Layer.localToParent,  lime.Layer.localToScreen,  lime.Layer.measureContents,  lime.Layer.needsDomElement,  lime.Layer.parentToLocal,  lime.Layer.removeAllChildren,  lime.Layer.removeChild,  lime.Layer.removeChildAt,  lime.Layer.removeDomElement,  lime.Layer.removeEventListener,  lime.Layer.runAction,  lime.Layer.screenToLocal,  lime.Layer.setAllow3DCSSTransforms,  lime.Layer.setAnchorPoint,  lime.Layer.setAutoResize,  lime.Layer.setChildIndex,  lime.Layer.setDirty,  lime.Layer.setHidden,  lime.Layer.setMask,  lime.Layer.setOpacity,  lime.Layer.setPosition,  lime.Layer.setQuality,  lime.Layer.setRenderer,  lime.Layer.setRotation,  lime.Layer.setScale,  lime.Layer.setSize,  lime.Layer.update,  lime.Layer.updateDomElement,  lime.Layer.updateLayout,  lime.Layer.wasAddedToTree,  lime.Layer.wasRemovedFromTree
Members
-
<static> Event :string
-
Button event names
- Source:
- button.js, line 71
Properties:
Name Type Default Description UP
string up DOWN
string down CLICK
string click -
<static> State :number
-
Button states
- Source:
- button.js, line 62
Properties:
Name Type Default Description UP
number 0 DOWN
number 1
Methods
-
getState() → {lime.Button.State}
-
Returns current state of the button
- Source:
- button.js, line 109
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:
- button.js, line 96
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:
- button.js, line 119
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:
- button.js, line 82
Returns:
object itself.- Type
- lime.Button