BoardToken Object

From BOARD18 Project WIKI
Revision as of 17:44, 5 August 2013 by Rich (talk | contribs) (added btindex)
(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 BoardToken constructor function.
Go to Object List. - Go to Design Document.

The BoardToken object describes a token that has been placed on the board.

Data Elements in Object
Element Type C Description
snumb int * Index number of token sheet object that contains this token
sheet object * Token sheet object that contains this token
index int * Index of token on token sheet
flip Boolean * True if token is flipped
bx int * X coordinate of token on map board
by int * Y coordinate of token on map board
hx int * X coordinate of hex containing this token
hy int * Y coordinate of hex containing this token
btindex int Index of this token in the BD18.boardTokens array

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

Methods in Object

place(alpha) The place function places the token on the board (canvas2).

togm() The togm function exports the boardToken as a JSON string.