Class: Setup

Setup

new Setup(jboard, boardOptions)

Setup helper class to make creating Canvases easy.
Parameters:
Name Type Description
jboard Board Board object to listen to.
boardOptions Object Base board options like BOARD.large.
Source:

Methods

create(elemId, readyFn)

Create Canvas based on current settings. When textures are used, image resources need to be loaded, so the function returns and asynchronously call readyFn after actual initialization.
Parameters:
Name Type Description
elemId Object The element id or HTML Node where to create the canvas in.
readyFn function Function to call with canvas once it is ready.
Source:

getNotifier() → {Notifier}

Get Notifier object created by this class. Can be used to change the board the canvas listens to.
Source:
Returns:
Canvas notifier.
Type
Notifier

setOptions(options)

Replace default options (non-viewport related)
Parameters:
Name Type Description
options Object The new options.
Source:

view(xOff, yOff, width, height)

View only a portion of the whole board.
Parameters:
Name Type Description
xOff int The X offset.
yOff int The Y offset.
width int The width.
height int The height.
Source: