Class Index | File Index

Classes


Class ScrollableView


Extends View.
view with scrollable content !CONSTRUCTOR PARAMETERS ARE PROVIDED IN A OBJECT LITERAL!
Defined in: gamejs-gui.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ScrollableView(parent, size, position, surface, visible)
Fields borrowed from class View:
children, parent, position, size, surface
Method Summary
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
 
adjusts event position based on scroll state
 
increment horizontal scroll
 
increment vertical scroll
 
set horizontal scrollbar for this view
 
manually set size of scrollable area
 
set horizontal scroll
 
set vertical scroll
 
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

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Aug 15 2011 16:17:32 GMT+0300 (EEST)