Class VerticalScrollbar
Extends
View.
!CONSTRUCTOR PARAMETERS ARE PROVIDED IN A OBJECT LITERAL!
Defined in: gamejs-gui.js.
Constructor Attributes | Constructor Name and Description |
---|---|
VerticalScrollbar(top_btn_image, scroller_image, bot_btn_image, parent, size, position, surface, visible)
|
Field Attributes | Field Name and Description |
---|---|
bottom scrollbar button
|
|
scroller class used to create scroller #TODO find better way to implement customization
|
|
top scrollbar button
|
Method Attributes | Method Name and Description |
---|---|
scrollUp()
|
|
setScroll(pos)
set scroll amount, relative
|
|
setScrollerSize(sz)
set relative scroller width
|
|
setScrollPX(pos)
set scroll amount, px
|
- Methods borrowed from class View:
- addChild, blitChild, center, despatchEvent, destroy, draw, getGUI, getPosition, getRect, getSize, hide, isFocused, isHovered, isVisible, move, moveRelative, on, paint, refresh, removeChild, resize, show, update
Class Detail
VerticalScrollbar(top_btn_image, scroller_image, bot_btn_image, parent, size, position, surface, visible)
- Parameters:
- {gamejs.Surface} top_btn_image
- image for top scrollbar button
- {gamejs.Surface} scroller_image
- image for scroller
- {gamejs.Surface} bot_btn_image
- image for bottom scrollbar button
- {View} parent
- parent element
- {Array} size
- array containing width & height of the element, eg. [width, height]
- {Array} position
- position of the view relative to parent, eg. [x, y]. OPTIONAL, default [0, 0]
- {gamejs.Surface} surface
- surface to render this view on, OPTIONAL
- {Bool} visible
- is this view visible? OPTIONAL, DEFAULT true
Field Detail
{Button}
bot_btn
bottom scrollbar button
{Scroller}
scroller
{Function}
scroller_class
scroller class used to create scroller #TODO find better way to implement customization
{Button}
top_btn
top scrollbar button
Method Detail
scrollDown()
scrollUp()
setScroll(pos)
set scroll amount, relative
- Parameters:
- {Number} pos
- scroll amount, between 0 and 1
setScrollerSize(sz)
set relative scroller width
- Parameters:
- {Number} sz
- relative scroller width, between 0.1 and 1,
setScrollPX(pos)
set scroll amount, px
- Parameters:
- {Number} pos
- scroll amount, px