Class ScrollableView
Extends
View.
view with scrollable content !CONSTRUCTOR PARAMETERS ARE PROVIDED IN A OBJECT LITERAL!
Defined in: gamejs-gui.js.
Constructor Attributes | Constructor Name and Description |
---|---|
ScrollableView(parent, size, position, surface, visible)
|
Method Attributes | Method Name and Description |
---|---|
addChild(child)
TODO: implement optional auto setting scrollable area when children are added
|
|
automatically set scrollable area based on children positions and sizes
|
|
blitChild(child)
implements child blitting adjusted to scroll state
|
|
despatchEvent(event)
adjusts event position based on scroll state
|
|
scrollX(x)
increment horizontal scroll
|
|
scrollY(y)
increment vertical scroll
|
|
setHorizontalScrollbar(scrollbar)
set horizontal scrollbar for this view
|
|
setScrollableArea(area)
manually set size of scrollable area
|
|
setScrollX(x)
set horizontal scroll
|
|
setScrollY(y)
set vertical scroll
|
|
setVerticalScrollbar(scrollbar)
set vertical scrollbar for this view
|
- Methods borrowed from class View:
- center, destroy, draw, getGUI, getPosition, getRect, getSize, hide, isFocused, isHovered, isVisible, move, moveRelative, on, paint, refresh, removeChild, resize, show, update
Class Detail
ScrollableView(parent, size, position, surface, visible)
- Parameters:
- {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
Method Detail
addChild(child)
TODO: implement optional auto setting scrollable area when children are added
- Parameters:
- child
autoSetScrollableArea()
automatically set scrollable area based on children positions and sizes
blitChild(child)
implements child blitting adjusted to scroll state
- Parameters:
- child
despatchEvent(event)
adjusts event position based on scroll state
- Parameters:
- event
scrollX(x)
increment horizontal scroll
- Parameters:
- {Number} x
- px to increment horizontal scroll by
scrollY(y)
increment vertical scroll
- Parameters:
- {Number} y
- px to increment vertical scroll by
setHorizontalScrollbar(scrollbar)
set horizontal scrollbar for this view
- Parameters:
- {HorizontalScrollbar} scrollbar
setScrollableArea(area)
manually set size of scrollable area
- Parameters:
- {Array} area
- scrollbale area, [width, height]
setScrollX(x)
set horizontal scroll
- Parameters:
- {Number} x
- horizontal scroll, px
setScrollY(y)
set vertical scroll
- Parameters:
- {Number} y
- vertical scroll, px
setVerticalScrollbar(scrollbar)
set vertical scrollbar for this view
- Parameters:
- {VerticalScrollbar} scrollbar