Pop.Box/main.lua

49 lines
1.4 KiB
Lua
Raw Normal View History

2016-01-20 22:34:25 +00:00
local pop = require "pop"
2015-11-18 03:27:06 +00:00
function love.load()
2016-01-21 23:37:33 +00:00
local align = pop.box():align("center", "center"):setSize(200, 200)
pop.box(align):align("left", "top"):setSize(75, 10):setColor(255, 0, 255, 255)
pop.box(align):align("center", "top"):setColor(100, 100, 100)
pop.box(align, {0, 255, 0, 255}):setSize(20, 5):align("right", "top")
pop.box(align):align("left", "center"):setColor(0, 0, 255)
pop.box(align):align("center", "center"):setSize(90, 90):setColor(255, 255, 255)
pop.box(align):align("right", "center"):setColor(255, 0, 0)
pop.box(align):align("left", "bottom"):setColor(0, 255, 0)
pop.box(align):align("center", "bottom"):setColor(255, 255, 0)
pop.box(align):align("right", "bottom"):setColor(0, 255, 255)
pop.box(nil, {255, 0, 0, 255}):align("left", "top"):setSize(50, 50)
2016-01-22 00:04:11 +00:00
pop.text(nil, "Hello World!"):align("center"):setText("Hey, I've been modified!")
2015-11-18 03:27:06 +00:00
end
2016-01-20 22:34:25 +00:00
function love.update(dt)
pop.update(dt)
end
2015-11-18 03:27:06 +00:00
function love.draw()
pop.draw()
end
2016-01-20 22:34:25 +00:00
function love.textinput(text)
pop.textinput(text)
end
2015-11-18 03:27:06 +00:00
function love.mousepressed(button, x, y)
pop.mousepressed(button, x, y)
end
function love.mousereleased(button, x, y)
pop.mousereleased(button, x, y)
end
2015-11-20 11:30:40 +00:00
function love.keypressed(key)
2015-11-30 19:55:52 +00:00
if key == "escape" then
love.event.quit()
2016-01-20 22:34:25 +00:00
else
pop.keypressed(key)
2015-11-20 11:30:40 +00:00
end
end
2016-01-20 22:34:25 +00:00
function love.keyreleased(key)
pop.keyreleased(key)
end