Where did you put that code? Can you share your project? It should work, but I don't know the context.
EDIT: isn't 1 left mouse button and 2 right mouse button?
function love.update(dt)
if love.mouse.isDown(1) then
text = "Right mouse button has been pressed"
end
if love.mouse.isDown(2) then
text = "Left mouse button has been pressed"
end
end
I guess he has text in a love.graphics.print in love.draw.
Anyways, you've got them wrong, they're the other way around. 1 is left mouse, 2 is right mouse, 3 is middle mouse button.
local text
function love.load()
love.graphics.setNewFont(12)
text = "Nothing yet"
end
function love.update(dt)
if love.mouse.isDown( '1' ) then
text = "Left mouse button has been pressed"
end
if love.mouse.isDown( '2' ) then
text = "Right mouse button has been pressed"
end
end
function love.draw()
love.graphics.print( text, 330, 300 )
end