new GOWN.Check(theme, skinName)
A toggle control that contains a label and a box that may be checked
or not to indicate selection.
Name | Type | Default | Description |
---|---|---|---|
theme |
GOWN.Theme | optional theme for the button | |
skinName |
String | Check.SKIN_NAME | optional name of the check skin |
Extends
Members
-
static,readonlyGOWN.Check.SKIN_NAMEString
-
Default check skin name
-
allowDestroyCachebool
-
Will destroy the skin cache when the skinable gets destroyed
- Default Value:
- true
-
currentStateString
-
The current state
-
enabledBoolean
-
Enables/Disables the control. (not implemented yet)
-
labelString
-
Create/Update the label of the button.
-
selectedBoolean
-
Indicate if the button is selected (pressed)
- Default Value:
- false
-
skinFallbackString
-
The fallback skin if the other skin does not exist (e.g. if a mobile theme that does not provide a "hover" state is used on a desktop system)
-
skinNameString
-
The skin name
- Default Value:
- Button.SKIN_NAME
Methods
-
inherited changeSkin(skin)
-
Remove old skin and add new one
Name Type Description skin
DisplayObject -
inherited destroy()
-
Destroy the Skinable and empty the skin cache
-
inherited fromSkin(name, callback)
-
Get image from skin (will execute a callback with the loaded skin when it is loaded or call it directly when it already is loaded)
Name Type Description name
String name of the state callback
function callback that is executed if the skin is loaded -
inherited protectedhandleEvent(type)
-
handle the touch/tap event
Name Type Description type
Object the type of the press/touch. -
inherited mousePos(){PIXI.Point}
-
Get the local mouse position from PIXI.InteractionData
Returns:
Type Description PIXI.Point -
inherited protectedonDown()
-
onDown callback
-
inherited protectedonHover()
-
onHover callback
-
inherited protectedonOut()
-
onOut callback
-
inherited protectedonTouchMove()
-
onTouchMove callback
-
inherited protectedonUp()
-
onUp callback
-
inherited protectedpreloadSkins()
-
Initiate all skins first (to prevent flickering)
-
inherited protectedredraw()
-
Update before draw call (position label)
-
inherited setTheme(theme)
-
Change the theme
Name Type Description theme
GOWN.Theme the new theme -
inherited protectedskinLoaded(skin)
-
Skin has been loaded (see preloadSkins) and stored into the skinCache. add to container, hide and resize
Name Type Description skin
the loaded skin -
inherited toggle()
-
Toggle the state
-
inherited protectedupdateDimensions()
-
Update width/height of the button
-
inherited updateTheme(data)
-
Overwrite data from theme for this specific component. (usable if you want to change e.g. background color based on selected items)
Name Type Description data
updated skin data