Table des matières

Language / Langue : FR | EN

Tiles And Tilemaps

Tiles extract one cell from a spritesheet. Tilemaps assemble several tiles into a grid, directly in the text or inside a persistent frame.

Extracting A Tile

text: "Tile: [[/scenarios/images/test/tiles.png:4x4:1:2]]"

The complete form is [[url:NxM:col:row]].

Inside text, a tile is shown at its real size: it is never enlarged unless you ask for it. Only a tile too large for the text area is reduced. Clicking it enlarges only the selected cell, not the whole spritesheet.

The rule applies on every platform, including the attachment produced by Discord.

Building A Grid

This 3×2 grid has 3 columns and 2 rows. It mixes direct images and tiles extracted from the showcase's 8×16 tileset:

text: |
  [[grid:3x2]]
  https://cyril-fiesta.fr/jdr-bot/scenarios/images/showcase/un.png | https://cyril-fiesta.fr/jdr-bot/scenarios/images/showcase/tileset-8-16.png:8x16:0:2 | https://cyril-fiesta.fr/jdr-bot/scenarios/images/showcase/un.png
  https://cyril-fiesta.fr/jdr-bot/scenarios/images/showcase/tileset-8-16.png:8x16:0:4 | https://cyril-fiesta.fr/jdr-bot/scenarios/images/showcase/un.png | https://cyril-fiesta.fr/jdr-bot/scenarios/images/showcase/tileset-8-16.png:8x16:3:6
  [[/grid]]

The dimensions after grid: describe the assembled grid; those after an image URL describe its source spritesheet. Do not put [[...]] around individual cells. Each line supplies one row, with three cells separated by |.

Each cell contains either an extracted tile with url:NxM:col:row, or a direct picture URL. Cells are separated with |.

Dynamic Variables

Coordinates can use variables between braces. This is useful for a minimap or HUD updated by events.

frame: |
  [[grid:3x3]]
  /scenarios/images/test/tiles.png:4x4:0:0 | /scenarios/images/test/tiles.png:4x4:1:0 | /scenarios/images/test/tiles.png:4x4:2:0
  /scenarios/images/test/tiles.png:4x4:0:1 | /scenarios/images/test/tiles.png:4x4:{map_x}:{map_y} | /scenarios/images/test/tiles.png:4x4:2:1
  /scenarios/images/test/tiles.png:4x4:0:2 | /scenarios/images/test/tiles.png:4x4:1:2 | /scenarios/images/test/tiles.png:4x4:2:2
  [[/grid]]

Grids placed in frame: refresh with the room, like other persistent information.

Useful Behaviours

Grid from a list (4.17)

lists:
  images: [portrait.png, '', 'tiles.png:8x16:2:1']
rooms:
  - id: gallery
    text: '[[grid:3:images]]'

The first number sets the columns; rows are calculated. Each value is an image or sprite reference without tags. An empty string reserves a blank cell. The last row is padded if needed; an empty list displays one blank row. The total is limited to 1,000 cells, including blanks.

A list path also works, including inside a loop. Rendering changes no data and adds no movement or collision rules. The [[grid:3x2]]...[[/grid]] form remains available.

HTML exports collect known images from declared lists and collections. Addresses calculated or received during play follow the dynamic media rules.