Inheritance Button
View
Module hilo/view/Button
Requires
hilo/core/Hilo, hilo/core/Class, hilo/view/View, hilo/view/Drawable, hilo/util/util
Source
Button.js
Button class is a simple button class, contains four kinds of state: 'up', 'over', 'down', 'disabled'
demo:
var btn = new Hilo.Button({ image: buttonImage, upState: {rect:[0, 0, 64, 64]}, overState: {rect:[64, 0, 64, 64]}, downState: {rect:[128, 0, 64, 64]}, disabledState: {rect:[192, 0, 64, 64]} });
Property | Defined | |
---|---|---|
disabledState:Object
The property of button 'disabled' state or collections of its drawable properties.
|
Button | |
downState:Object
The property of button 'down' state or collections of its drawable properties.
|
Button | |
enabled:Boolean
Is button enabled.
|
Button | |
overState:Object
The property of button 'over' state or collections of its drawable properties.
|
Button | |
state:String
the state name of button, could be one of Button.UP|OVER|DOWN|DISABLED, readonly!
|
Button | |
upState:Object
The property of button 'up' state or collections of its drawable properties.
|
Button | |
useHandCursor:Boolean
If true, cursor over the button will become a pointer cursor, default value is true.
|
Button | |
OVER:String
static
Statics value of Button's 'over' state.
|
Button | |
DOWN:String
static
Statics value of Button's 'down' state.
|
Button | |
DISABLED:String
static
Statics value of Button's 'disabled' state.
|
Button | |
UP:String
static
Statics value of Button's 'up' state.
|
Button |
Method | Defined | |
---|---|---|
Button(properties:Object)
Constructor
|
Button | |
setEnabled(enabled:Boolean):Button
Set whether the button is enabled.
|
Button | |
setState(state:String):Button
Set the state of the button.
|
Button |