pico8-0hh1/visuals.lua

40 lines
695 B
Lua
Raw Normal View History

2022-07-12 21:47:10 +02:00
local overlays = {}
function get_main_color(tint)
if tint == BLUE then
return 12
elseif tint == YELLOW then
return 8
else
return 1
end
end
function get_shade_color(tint)
if tint == BLUE then
return 13
elseif tint == YELLOW then
return 4
else
return 1
end
end
function spawn_tile_transition(x, y, w, h, from_tint, to_tint)
local p = #patterns
local from_color = get_main_color(from_tint)
local to_color = get_main_color(to_tint)
add(overlays, {
_draw = function(self)
fillp()
rectfill(x, y, x + w, y + h, from_color)
2022-09-24 15:22:18 +02:00
fillp(patterns[p\1]+0b0.1)
2022-07-12 21:47:10 +02:00
rectfill(x, y, x + w, y + h, to_color)
2022-09-24 15:22:18 +02:00
p -= 1
2022-07-12 21:47:10 +02:00
if p < 1 then
del(overlays, self)
end
end
})
end