-
-
Notifications
You must be signed in to change notification settings - Fork 492
Josh Goebel edited this page Jan 25, 2021
·
22 revisions
OVR() is called on every frame. It draws on a separate layer and can be used together with SCN() to create separate background or foreground layers and other visual effects.
Note: You cannot currently poke
to VRAM during OVR()
. Ref: https://github.com/nesbox/TIC-80/issues/1305
This API was added in 0.60.
function OVR()
--Draw foreground
end
-- title: Overlap demo
-- author: librorumque
-- desc: OVR() example
-- script: lua
PALETTE_ADDR=0x03FC0
CHANGE_COL=8
SCR_HEI=136
x=96
y=24
function SCN(line)
--[[
Gradient background
]]
local color=(0xff*line/SCR_HEI)//32*32
poke(PALETTE_ADDR+3*CHANGE_COL, color)
end
function OVR()
--[[
This sprite uses the same blue as the
background, but it's not affected by
scanline() palette swap
]]
spr(1,x,y,14,3,0,0,2,2)
end
function TIC()
cls(8)
print("OVR() example", 85, 3)
print("Press up or down to move the sprite", 22, 10)
if btn(0) then y=y-1 end
if btn(1) then y=y+1 end
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)