TileDisplay.extent

From MiniScript Wiki
Revision as of 04:43, 19 September 2021 by JoeStrout (talk | contribs) (Created page with "In Mini Micro, the <c>extent</c> property of a TileDisplay is used to set the number of columns and rows in the display. It can be either a simple number, used for bo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In Mini Micro, the extent property of a TileDisplay is used to set the number of columns and rows in the display. It can be either a simple number, used for both columns and rows; or a two-element list containing the desired number of columns and rows.

Example

The following code prepares a tile display with 15 columns and 10 rows:

display(5).mode = displayMode.tile
td = display(5)
td.tileSet = file.loadImage("/sys/pics/TileShapes.png")
td.tileSetTileSize = 64  // size of each tile in the image
td.extent = [15, 10]  // columns, rows on screen

(See TileDisplay for the full version of this example.)