-
-
Notifications
You must be signed in to change notification settings - Fork 490
Vadim Grigoruk edited this page May 12, 2017
·
31 revisions
map [x=0 y=0] [w=30 h=17] [sx=0 sy=0] [colorkey=-1] [scale=1] [remap=nil] [cellx celly cellw cellh [sx sy [colorkey] ] ]
- x : The left-most cell to start drawing the map.
- y : The top-most cell to start drawing the map.
- w : The amount of cells to draw horizontally from cellx.
- h : The amount of cells to draw vertically from celly.
- sx : The x coordinate to draw the map to the screen.
- sy : The y coordinate to draw the map to the screen.
- colorkey : The indexed color (0-15) to use as the alpha channel. Not setting this parameter will apply no blending.
- remap: function callback called before every tile drawing, you can show/hide tiles on map rendering stage (also, you can remap tile index to make map animation or even flip/rotate):
callback [tile [x y] ] -> [tile [flip [rotate] ] ]
The map is measured in cells, 8x8 blocks where you can place sprites in the map editor. This function will draw the entire map, or parts of it. The map's cell limit is 240x136.
--divide the map into rooms
rooms = {}
for x = 0,240-30,30 do
for y = 0,136-17,17 do
table.insert(rooms, {x,y})
end
end
--returns the room by index (1-64)
function rget(i)
return rooms[i][1],rooms[i][2],30,17
end
function TIC()
cls()
map(rget(64))
end
TIC-80 tiny computer https://tic80.com | Twitter | Telegram | Terms
Built-in Editors
Console
Platform
RAM & VRAM | Display | Palette | Bits per Pixel (BPP) |
.tic
Format | Supported Languages
Other
Tutorials | Code Snippets | Libraries | External Tools | FFT
API
- BDR (0.90)
- BOOT (1.0)
- MENU
- OVR (deprecated)
- SCN (deprecated)
- TIC
- btn & btnp
- circ & circb
- clip
- cls
- elli & ellib (0.90)
- exit
- fget & fset (0.80)
- font
- key & keyp
- line
- map
- memcpy & memset
- mget & mset
- mouse
- music
- peek, peek4
- peek1, peek2 (1.0)
- pix
- pmem
- poke, poke4
- poke1, poke2 (1.0)
- rect & rectb
- reset
- sfx
- spr
- sync
- ttri (1.0)
- time
- trace
- tri & trib (0.90)
- tstamp (0.80)
- vbank (1.0)