I just started to make a game with LÖVE Framework and already got some problems.
Everytime i try to use the love.mouse.isDown method or the mousepressed function nothing happens.
I tried different approaches and searched the forum for information but nothing helped so far.
These are my current codes:
Code: Select all
function love.update()
mx = love.mouse.getX()
my = love.mouse.getY()
if love.mouse.isDown("l") then
love.graphics.print(mx, 0, 0)
love.graphics.print(my, 0, 20)
end
end
Code: Select all
function love.mousepressed(mx, my, button)
mx = love.mouse.getX()
my = love.mouse.getY()
if button == "l" then
if mx > (sc_width / 2 - 60) and mx < (sc_width / 2 + 60) and my > (sc_height / 2 - 40) and my < (sc_height / 2) then
love.graphics.print("Button pressed!", 0, 0)
end
end
end
I really hope somebody can help me. It looks like I just missed a small detail.