Difference between revisions of "Board18Map6"
(→Function mapMouseEvent(event): added link to Board18Map5) |
(added release note) |
||
Line 1: | Line 1: | ||
board18Map6.js contains all the functions that | {{ReleaseNotice|1.0}}board18Map6.js contains all the functions that | ||
respond to various onclick events on the game board in the | respond to various onclick events on the game board in the | ||
Map page and on the main and tray menus. <br>But note that right click | Map page and on the main and tray menus. <br>But note that right click |
Revision as of 08:26, 21 May 2015
This page has been updated to comply with Release 1.0.x of BOARD18. |
board18Map6.js contains all the functions that
respond to various onclick events on the game board in the
Map page and on the main and tray menus.
But note that right click
events that cause a context menu to be displayed are handled
by functions in the board18Map5.js file.
Function registerMainMenu()
The registerMainMenu function creates the main menu on the board18Map page. It uses the jquery context menu plugin.
Function makeTrayItems()
The makeTrayItems function will use the BD18.trays array to construct the items to be displayed in the tray menu.
Function registerTrayMenu()
The registerTrayMenu function creates the tray menu on the board18Map page. It uses the jquery context menu plugin and the makeTrayItems function.
Function tilePos(event)
This function calculates the board coordinates of a map tile given the raw coordinates of a mouse click event.
Function traySelect(event)
This function responds to onclick events in the trays canvas. It selects a item from those currently displayed and highlites the selected item.
Function hexSelect(event)
This function responds to left mousedown events in the map canvas. It checks various conditions and executes the appropriate function based on them. If it can find no relevant condition then it merely returns.
Function mapMouseEvent(event)
This function responds to mousedown events on the map canvas. It uses event.witch to determine which mouse button was pressed. If the left or center button was pressed then it calls the hexSelect functon. Otherwise it assumes that the right button was pressed and does nothing. Right mouse events are handled by the jquery.contextMenu library (see the makeMenus function in board18Map5.js).
Function doit(mm)
This function is called via onclick events coded into the main menu on the board18Map page. the passed parameter indicates the menu choice to be acted upon.