Pop.Box/main.lua

35 lines
903 B
Lua
Raw Normal View History

2015-11-20 11:30:40 +00:00
local pop = require "pop" --TODO tell user that pop must be required with SLASHES
2015-11-18 03:27:06 +00:00
function love.load()
2015-11-21 00:41:11 +00:00
local box = pop.box() -- returns the box element
2015-11-18 03:27:06 +00:00
-- or pop.create("box") (this is what is actually called when you call pop.box())
2015-11-21 00:41:11 +00:00
--TODO uncomment these once text is implemented!
--local text = pop.text(box) -- box will become the parent element of text
--text:setText("Hello and welcome to an example of Pop.Box, a very small shitty example.")
2015-11-18 03:27:06 +00:00
end
function love.draw()
pop.draw()
end
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-21 00:41:11 +00:00
if not pop.keypressed(key, unicode) then
if key == "escape" then
love.event.quit()
end
2015-11-20 11:30:40 +00:00
end
end
2015-11-21 00:41:11 +00:00
function love.keyreleased(key)
pop.keyreleased(key)
end