glerminal/lua-examples/basic/main.lua
Shylie 45ec13db45
Some checks failed
Make PNG / build-app (push) Failing after 34s
Add mouse callbacks
2024-06-11 00:40:43 -04:00

35 lines
766 B
Lua

local time = 0
function glerminal.init()
if not glerminal.sprites('sprites.png') then
print('failed to load sprites')
end
for i = 1, 40 do
for j = 1, 25 do
glerminal.set(i, j, 1, 2)
end
end
glerminal.tint(1, 0xA0FFFFFF)
glerminal.flush()
end
function glerminal.main(dt)
time = time + dt / 2
for i = 1, 40 do
for j = 1, 25 do
glerminal.offset(i, j, 1, math.cos(time * i / math.pi), math.sin(time * j / math.pi))
end
end
glerminal.flush()
end
function glerminal.keypresse(key) end
function glerminal.keyrelease(key) end
function glerminal.mousemove(x, y) end
function glerminal.mousepress(button, x, y) end
function glerminal.mouserelease(button, x, y) end