Board18Map2

From BOARD18 Project WIKI
Revision as of 08:28, 28 July 2017 by Rich (talk | contribs) (added Function doLink(linkURL))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This page has been updated to comply with Release 2.5.x of BOARD18. Go Back

board18Map2.js contains the BOARD18Map startup functions.

Function makeTrays()

The makeTrays() function initializes all of the tray objects. It calls the TileSheet constructor for each tile sheet. It calls the TokenSheet constructor for each token sheet. It also adds the trayNumb to each new tray object. Finally it initializes BD18.curTrayNumb to 0 and BD18.trayCount to the number of tray objects.

Function makeBdTileList()

This function initializes the BD18.boardTiles array. It calls the BoardTile constructor for each tile in BD18.gm.brdTls array and adds the new object to the BD18.boardTiles array.

Function makeBdTokenList()

This function initializes the BD18.boardTokens array. It calls the BoardToken constructor for each token in BD18.gm.brdTks array and adds the new object to the BD18.boardTokens array.

Function trayCanvasApp()

Function trayCanvasApp calls the trays.place() method for the current tile/token sheet object.

This sets up the tray Canvas.

Function mainCanvasApp()

Function mainCanvasApp calls the gameBoard.place() method. This sets up the main Canvas. It then places all existing tiles on the game board using the BD18.boardTiles array.

Function toknCanvasApp(keepHexSelect)

Function toknCanvasApp places all existing tokens on the game board using the BD18.boardTokens array.

Function canvasApp()

Function CanvasApp initializes all canvases. It then calls trayCanvasApp, tokenCanvasApp and mainCanvasApp.

Function itemLoaded(event)

This function is an event handler for the game box images. It calls makeTrays, makeBdTileList, canvasApp and delayCheckForUpdate after all itemLoaded events have occured.

Function doLink(linkURL)

The doLinks function is called by the

  • statements which are created by the loadLinks function below.

    Function loadLinks(newLinks)

    The loadLinks function is called by loadBox and getLinks functions to add box and game links to the "Useful Links" sub-menu.

    Function loadBox(box)

    The loadBox function is a callback function for the gameBox.php getJSON function. It loads all the game box images.

    It also initializes the BD18.gm.trayCounts array if it is undefined or empty.

    Function loadSession(session)

    The loadSession function is a callback function for the gameSession.php getJSON function. It finds and loads the game box file.