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

Available Packages:

Board

Source

function dynamicCell(T defaultValue, DynamicCellValue observer) returns DynamicCellValue

Source

function dynamicCellIcon(string icon, DynamicCellValue observer) returns DynamicCellValue

Source

This Board library allows you to create a simple multi board with dynamic cell values. 1. Create a board `let board = new Board("myBoard", 0.02)` 2. Define columns. The second parameter is width relative to board width. `board.columns(asList(new BoardColumn("Player", 0.7), new BoardColumn(COLOR_GOLD.toColorString() + "Kills", 0.3)))` 3. Add rows and cells `let killcount = dynamicCell(0, i -> i.toString()) board.addRow() ..addCell("My Name") ..addDynamic(killcount)` 4. Show board `board.show()` 5. Update dynamic value `killcount.updateValue(killcount.value + 1)`

class Board

Source

LinkedList columns

Source

LinkedList rows

Source

real width

Source

function addRow() returns BoardRow

Source

Add a new row to the board

function columns(LinkedList columns)

Source

Initialize the boards columns

function getBoard() returns multiboard

Source

Unsafe access to the underlying multiboard

function removeRow(BoardRow row)

Source

Remove a row from the board, e.g. when a player leaves

function show()

Source

Show the board to players

class BoardCell

Source

int column

Source

string content

Source

string icon

Source

BoardRow parent

Source

function setContent(string content)

Source

Sets the text content of this cell

function setIcon(string icon)

Source

Sets the icon of this cell

class BoardColumn

Source

int columnIndex

Source

string icon

Source

string title

Source

real width

Source

class BoardRow

Source

multiboard board

Source

LinkedList cells

Source

int rowIndex

Source

function addCell(string text)

Source

Adds a cell to this column with a static text content

function addCell(string text, string icon)

Source

Adds a cell to this column with a static text and icon content

function addDynamic(DynamicCellValue dynamicValue)

Source

Adds a cell to this column with a dynamic text content. If the observable 'dynamicValue' is updated via 'updateValue', the cell's value will be updated as well.

function invalidate()

Source

Issues all cells to redraw their content

class DynamicCellValue

Source

BoardCell cell

Source

string icon

Source

T value

Source

function getIcon() returns string

Source

function getString() returns string

Source

function toString(T t) returns string

Source

Returns a string representation of T

function updateIcon(string icon)

Source

Updates the cell's icon

function updateValue(T value)

Source

Updates the cell's value