Class: ScrollThumb

ScrollThumb

ScrollThumb

new GOWN.ScrollThumb(scrollable, theme, skinName)

Thumb button that can be moved on the scrollbar
Name Type Default Description
scrollable GOWN.Scrollable The scrollable that the scroll thumb belongs to
theme GOWN.Theme optional theme for the scroll thumb
skinName String ScrollThumb.SKIN_NAME optional name of the scroll thumb skin

Extends

Members

static,readonlyGOWN.ScrollThumb.SKIN_NAMEString

Default scroll thumb skin name

allowDestroyCachebool

Will destroy the skin cache when the skinable gets destroyed
Default Value:
  • true

currentStateString

The current state (one of _validStates)

enabledBoolean

Enables/Disables the control. (not implemented yet)

heightNumber

The height of the scroll thumb

labelString

Create/Update the label of the button.

scrollableGOWN.Scrollable

The scrollable that the scroll thumb belongs to

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

The skin name
Default Value:
  • ScrollThumb.SKIN_NAME

widthNumber

The width of the scroll thumb

Methods

inherited changeSkin(skin)

Remove old skin and add new one
Name Type Description
skin DisplayObject
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 one of the mouse/touch events
Name Type Description
type one of the valid states

protectedhandleMove()

onMove callback

protectedhandleUp()

onUp callback

inherited mousePos(){PIXI.Point}

Get the local mouse position from PIXI.InteractionData
Returns:
Type Description
PIXI.Point

move(x, y){boolean}

Move the thumb on the scroll bar within its bounds
Name Type Description
x Number New calculated x position of the thumb
y Number New calculated y position of the thumb
Returns:
Type Description
boolean returns true if the position of the thumb has been moved
onDown callback

inherited protectedonHover()

onHover callback
onOut callback

inherited protectedonTouchMove()

onTouchMove callback
onUp callback

inherited protectedpreloadSkins()

Initiate all skins first (to prevent flickering)
Change the theme
Name Type Description
theme GOWN.Theme the new theme
Show track icon on thumb
Name Type Description
skin String The new scroll thumb skin name

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 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