diff --git a/vacation.p8 b/vacation.p8 index a7b864e..6d51f75 100644 --- a/vacation.p8 +++ b/vacation.p8 @@ -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)