deck

Algorithmic layout of expansion boards and decks.
Constants
placeTile( deckEditor, nameKey, orientation, x, y )
cornerTile( n )
edgeTile( n )
tileWidth( deckEditor )
tileHeight( deckEditor )
createOtherWorldBand( deckEditor ) {
createTextBox( text, x, y, width, height, page )

Algorithmic layout of expansion boards and decks.

This library is intended for use by the scripts that create new expansion board editors, but it can be included in any script.

Constants

EDGE_TILES the number of different standard edge tiles
CORNER_TILES the number of different standard corner tiles
UPRIGHT the standard tile orientation
TURN_LEFT the orientation of a tile turned 90 degrees counter-clockwise
UPSIDEDOWN the orientation of a tile turned 180 degrees
TURN_RIGHT the orientation of a tile turned 90 degrees clockwise
MIRROR_UPRIGHT the orientation that is the mirror image of UPRIGHT
MIRROR_TURN_LEFT the orientation that is the mirror image of TURN_LEFT
MIRROR_UPSIDEDOWN the orientation that is the mirror image of UPSIDEDOWN
MIRROR_TURN_RIGHT the orientation that is the mirror image of TURN_RIGHT

placeTile( deckEditor, nameKey, orientation, x, y )

Place a tile on a page. The location is given in tile coordinates; placing a tile at x=1 y=0 puts it immediately to the right of a tile at x=0 y=0 that is the same size as the one being placed.

If a coordinate is less than 0, it will count backwards from the right (bottom) edge: x=-1 specifies the rightmost tile position. Note: tiles are assumed to be equal in size, which is true of the tiles included with the standard Strange Eons distribution.

deckEditor the deck editor that contains the document to modify
nameKey the name key of the tile to create, from resources/board/tile-set.txt
orientation the rotation and mirroring to apply to the tile
x the x-coordinate to place the tile at
y the y-coordinate to place the tile at

cornerTile( n )

Returns the key of nth standard corner tile. The value of n should be between 1 and CORNER_TILES, inclusive.

edgeTile( n )

Returns the key of the nth edge tile. The value of n should be between 1 and EDGE_TILES, inclusive.

tileWidth( deckEditor )

Return the width of the pages in a deck, measured in standard map tiles.

deckEditor the deck editor to find the tile width of

tileHeight( deckEditor )

Return the height of the pages in a deck, measured in standard map tiles.

deckEditor the deck editor to find the tile height of

createOtherWorldBand( deckEditor ) {

Adds the standard green band in which other worlds are positioned to the right side of the board.

deckEditor the deck editor that contains the document to modify

createTextBox( text, x, y, width, height, page )

Create and optionally place a text box. The text box is returned so that it can be further modifed if desired (for example, to change the background colour or border). If a page is specified, the text box will be added to it.

text the mark-up text to appear in the box
x the x-location (in points) to place the box
y the y-location (in points) to place the box
width the width of the box (in points)
height the height of the box (in points)
page a deck page that the text box will be added to (optional)

Index    Contents