TokenSheet Object

From BOARD18 Project WIKI
Revision as of 11:37, 4 June 2013 by Rich (talk | contribs) (Rich moved page TokenSheet to TokenSheet Object: It's an object.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This page describes a BOARD18 JavaScript object.
This object is created using the TokenSheet constructor function.
Go to Object List. - Go to Design Document.

The TokenSheet object describes a token sheet and its use.

Data Elements in Object
Element Type C Description
image url * URL of the image file
sheetType string * 'btok' or 'mtok' (see note)
trayName string * Name of tray for this sheet
xStart int * Start of token rows
xSize int * Width of tokens
xStep int * Spacing of tokens in rows
yStart int * Start of token columns
ySize int * Hight of tokens
yStep int * Spacing of tokens in columns
tokensOnSheet int * Count of token rows on sheet
tokenDups array of int * Count of available tokens (see note)
tokenFlip array of boolean * True if token has a back side

An * in the "C" column indicates that the element is created by the constructor function.

NOTE: Sheet Type 'btok' indicates a board token sheet. This sheet type has a tokenDups array. Sheet Type 'mtok' indicates a market token sheet. This sheet type does not have a tokenDups array.

Methods in Object

place(high) The place function places the token sheet on the tray (canvas0).