add color fade to text box, default to intended semantic text palette

This commit is contained in:
Kistaro Windrider 2024-02-10 16:10:34 -08:00
parent 1529548d61
commit 38bac54ff0
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -305,19 +305,28 @@ end
-- text rendering
-- text colors for zonk mode:
-- 8 -- standard
-- 9 -- delayed fade
-- 10 -- currently fading in
txtbox = {
x=0,
y=0,
text="???",
col=8,
cols={14, 10, 9, 8},
f=0,
interval=4,
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()
poke(0x5f58, self.mode)