new GOWN.Skinable(theme)
Control with a managed skin
(e.g. a button that has different skins for up/hover/down states)
Name | Type | Default | Description |
---|---|---|---|
theme |
GOWN.Theme | GOWN.theme | optional theme for the skinable |
Extends
Members
-
allowDestroyCachebool
-
Will destroy the skin cache when the skinable gets destroyed
- Default Value:
- true
-
enabledBoolean
-
Enables/Disables the control. (not implemented yet)
-
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) (normally the default "up"-state skin)
- Default Value:
- 'up'
-
skinNameString
-
Change the skin name. You normally set the skin name as constant in your control, but if you want you can set another skin name to change skins for single components at runtime.
Methods
-
changeSkin(skin)
-
Remove old skin and add new one
Name Type Description skin
DisplayObject -
destroy()
-
Destroy the Skinable and empty the skin cache
-
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 mousePos(){PIXI.Point}
-
Get the local mouse position from PIXI.InteractionData
Returns:
Type Description PIXI.Point -
preloadSkins()
-
Initiate all skins first
-
setTheme(theme)
-
Change the theme
Name Type Description theme
GOWN.Theme the new theme -
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