Stuck with functions
Posted: Sat May 10, 2014 1:04 am
I know it's more related question for LUA then for Love2D but i'm asking for help. I had just two simple lua scipts.
First is "buttons.lua"
and "main.lua"
I'm trying to create function that creates and draw buttons and i am totally don't understand why it doesn't works. I'll be glad if you tell me where is the problem. I am newbie at programming.
Regards Blackhardd.
First is "buttons.lua"
Code: Select all
function createBtn( imgPath, btnName )
btnName = love.graphics.newImage(imgPath)
end
Code: Select all
require("buttons")
function love.load()
createBtn("Sprites/Menu/exit.png", exit_btn)
end
function love.update(dt)
end
function love.draw()
love.graphics.draw(exit_btn, 200, 200)
end
Regards Blackhardd.