new GOWN.Slider(theme)
Simple slider with min. and max. value
| Name | Type | Description |
|---|---|---|
theme |
GOWN.Theme | optional theme for the slider |
Extends
Members
-
static,readonlyGOWN.Slider.SKIN_NAMEString
-
Default slider skin name
-
allowDestroyCachebool
-
Will destroy the skin cache when the skinable gets destroyed
- Default Value:
- true
-
directionString
-
The scrollable direction
- Default Value:
- Scrollable.HORIZONTAL
-
enabledBoolean
-
Enables/Disables the control. (not implemented yet)
-
heightNumber
-
The height of the Scrollable, setting this will redraw the track and thumb.
-
inverseBoolean
-
Inverse the progress bar
-
maximumNumber
-
Set maximum and update value if necessary
- Default Value:
- 100
-
minimumNumber
-
Set minimum and update value if necessary
- Default Value:
- 0
-
modeString
-
The scrollable mode
- Default Value:
- Scrollable.DESKTOP_MODE
-
scrolldeltaNumber
-
Number of pixels you scroll at a time (if the event delta is 1 / -1)
- Default Value:
- 10
-
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.
-
valueNumber
-
Set value (between minimum and maximum)
- Default Value:
- 0
-
widthNumber
-
The width of the Scrollable, setting this will redraw the track and thumb.
Methods
-
inherited changeSkin(skin)
-
Remove old skin and add new one
Name Type Description skinDisplayObject -
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 nameString name of the state callbackfunction callback that is executed if the skin is loaded -
inherited protectedhandleDown(mouseData)
-
Handle mouse down/touch start. Move scroll thumb.
Name Type Description mouseDatamouse data provided by PIXI -
inherited protectedhandleMove(mouseData)
-
Handle mouse move. Moves the thumb.
Name Type Description mouseDatamouse data provided by PIXI -
inherited protectedhandleUp()
-
Handle mouse up/touch end
-
inherited protectedhandleWheel(event)
-
Handle mouse wheel. Moves thumb on track.
Name Type Description eventmouse wheel event from browser -
inherited maxHeight(){Number}
-
Returns the max. height in pixel (normally this.height - thumb height)
Returns:
Type Description Number -
inherited maxWidth(){Number}
-
Returns the max. width in pixel (normally this.width - thumb width)
Returns:
Type Description Number -
inherited mousePos(){PIXI.Point}
-
Get the local mouse position from PIXI.InteractionData
Returns:
Type Description PIXI.Point -
inherited moveThumb(x, y){boolean}
-
Move the thumb on the scroll bar within its bounds
Name Type Description xNumber New x position of the thumb yNumber New y position of the thumb Returns:
Type Description boolean Returns true if the position of the thumb has been moved -
inherited pixelToValue(position){Number}
-
Calculate value of slider based on the current pixel position of the thumb
Name Type Description positionNumber current pixel position of the thumb Returns:
Type Description Number Value between minimum and maximum -
inherited positionThumb(value)
-
Position the thumb to a given value
Name Type Description valueNumber The value to which the thumb gets moved -
inherited preloadSkins()
-
Initiate all skins first
-
inherited protectedredraw()
-
Update before draw call. Redraw track and progressbar and create thumb.
-
inherited scrollToPosition()
-
Scroll to a specific position (not implemented yet)
-
inherited setTheme(theme)
-
Change the theme
Name Type Description themeGOWN.Theme the new theme -
inherited thumbMoved(x, y)
-
Thumb has new x/y position
Name Type Description xNumber x-position that has been scrolled to (ignored when vertical) yNumber y-position that has been scrolled to (ignored when horizontal) -
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 dataupdated skin data -
inherited valueToPixel(value){Number}
-
Calculate current pixel position of thumb based on given value
Name Type Description valueNumber The value of the thumb position Returns:
Type Description Number Position of the scroll thumb in pixel