Difference between revisions of "Board18Map2"

From BOARD18 Project WIKI
Jump to navigation Jump to search
(→‎Function itemLoaded(event): Function loadLinks)
(added Function doLink(linkURL))
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{ReleaseNoticeX|1.3|Design_Document_board18Map_Page}}
{{ReleaseNoticeX|2.5|Design_Document_board18Map_Page}}
board18Map2.js contains the BOARD18Map startup functions.
board18Map2.js contains the BOARD18Map startup functions.


Line 45: Line 45:
It calls makeTrays, makeBdTileList, canvasApp and  
It calls makeTrays, makeBdTileList, canvasApp and  
delayCheckForUpdate after all itemLoaded events have occured.
delayCheckForUpdate after all itemLoaded events have occured.
== Function doLink(linkURL) ==
The doLinks function is called by the <li> statements
which are created by the loadLinks function below.


== Function loadLinks(newLinks) ==
== Function loadLinks(newLinks) ==
Line 56: Line 60:


It also initializes the BD18.gm.trayCounts array if it is undefined or empty.
It also initializes the BD18.gm.trayCounts array if it is undefined or empty.
Finally it calls the makeMenues function.


==Function loadSession(session)==
==Function loadSession(session)==

Latest revision as of 08:28, 28 July 2017

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.