The polygon function is inside the love.load function. The polygon doesn't show up at all.
Code: Select all
local text = "The key you pressed is : "
function createtext(txt, x, y)
function love.draw()
love.graphics.printf(txt, x, y, 500, "left")
end
end
function love.load()
love.graphics.setBackgroundColor(200,200,200)
love.graphics.setCaption("ohai")
love.graphics.setColor(0, 100, 0)
love.graphics.polygon("line", 10, 400, 200, 50, 300, 20, 500, 500)
createtext("Please press a key", 400, 400)
end
function love.keypressed(key)
text = text..""..key
createtext(text, 0, 400)
end
Also, I would like help with another thing. I'm currently on a Mac. Is there a way for me to make a .exe file from a .love file on a Mac? I already know how to make a .app file.
Any help is appreciate. Thanks!