add color fade to text box, default to intended semantic text palette
This commit is contained in:
parent
1529548d61
commit
38bac54ff0
23
vacation.p8
23
vacation.p8
@ -305,19 +305,28 @@ end
|
|||||||
-- text rendering
|
-- text rendering
|
||||||
|
|
||||||
-- text colors for zonk mode:
|
-- text colors for zonk mode:
|
||||||
-- 8 -- standard
|
|
||||||
-- 9 -- delayed fade
|
|
||||||
-- 10 -- currently fading in
|
|
||||||
txtbox = {
|
txtbox = {
|
||||||
x=0,
|
x=0,
|
||||||
y=0,
|
y=0,
|
||||||
text="???",
|
cols={14, 10, 9, 8},
|
||||||
col=8,
|
f=0,
|
||||||
|
interval=4,
|
||||||
mode=0x81,
|
mode=0x81,
|
||||||
}
|
}
|
||||||
mknew(txtbox)
|
mknew(txtbox, function(self)
|
||||||
|
if (not self.cols) self.cols = {14,10,9,8}
|
||||||
|
self.c = deli(self.cols)
|
||||||
|
end)
|
||||||
|
|
||||||
function txtbox:update() end
|
function txtbox:update()
|
||||||
|
if #self.cols > 0 then
|
||||||
|
self.f += 1
|
||||||
|
if self.f >= self.interval then
|
||||||
|
self.f = 0
|
||||||
|
self.col = deli(self.cols)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function txtbox:draw()
|
function txtbox:draw()
|
||||||
poke(0x5f58, self.mode)
|
poke(0x5f58, self.mode)
|
||||||
|
Loading…
Reference in New Issue
Block a user