lovr.mousepressed

Edit

This callback is called when a mouse button is pressed.

function lovr.mousepressed(x, y, button)
  -- your code here
end

Arguments

NameTypeDescription
xnumber The x position of the mouse when the button was pressed.
ynumber The y position of the mouse when the button was pressed.
buttonnumber The button that was pressed. Will be 1 for the primary button, 2 for the secondary button, or 3 for the middle mouse button.

Returns

Nothing

See also