Your browser does not support HTML5 canvas. Fork me on GitHub

Available Packages:

DialogBox

Source

class DialogBox

Source

DialogBox lets you create dialogs more easily and associate its buttons with closures. WARNING: Dialogs cannot be displayed at map init! The DialogBox should be destroyed after it is no longer needed. Example use: let dBox = new DialogBox("Extra starting gold?") dBox.addButton("Yes") -> players[0].addGold(500) destroy dBox dBox.addButton("No", () -> destroy dBox) // Make sure to not call display at map initialization dBox.display(players[0], true)

function addButton(string buttonText)

Source

function addButton(string buttonText, DialogBoxButtonClosure cb)

Source

function addButton(string buttonText, int hotkey)

Source

Hotkey: use ASCII number of the capital letter.

function addButton(string buttonText, int hotkey, DialogBoxButtonClosure cb)

Source

Hotkey: use ASCII number of the capital letter.

function addQuitButton(boolean doScoreScreen, string buttonText)

Source

Adds a quit button to this dialog. If it is clicked, it ends the game for that player.

function addQuitButton(boolean doScoreScreen, string buttonText, DialogBoxButtonClosure cb)

Source

Adds a quit button to this dialog. If it is clicked, it ends the game for that player.

function addQuitButton(boolean doScoreScreen, string buttonText, int hotkey)

Source

Adds a quit button to this dialog. If it is clicked, it ends the game for that player. Hotkey: use ASCII numbers of the capital letter.

function addQuitButton(boolean doScoreScreen, string buttonText, int hotkey, DialogBoxButtonClosure cb)

Source

Adds a quit button to this dialog. If it is clicked, it ends the game for that player. Hotkey: use ASCII numbers of the capital letter.

function display(player whichPlayer, boolean flag)

Source

Toggles visibility of the DialogBox for a player. Dialogs are invisible by default WARNING: Dialogs cannot be shown at map initialization

function getTitle() returns string

Source

Returns the title of the DialogBox.

function setTitle(string title)

Source

Changes the title of the DialogBox.

interface DialogBoxButtonClosure

Source

function run()

Source