Allow overriding of the mouse position getter.
Useful if the ui is positioned behind the camera as opposed as in front of it. Signed-off-by: Saggi Mizrahi <ficoos@gmail.com>
This commit is contained in:
parent
52d06037d1
commit
944a250ec5
1 changed files with 2 additions and 1 deletions
|
@ -60,7 +60,7 @@ end
|
||||||
|
|
||||||
local function beginFrame()
|
local function beginFrame()
|
||||||
hot = nil
|
hot = nil
|
||||||
x,y = love.mouse.getPosition()
|
x,y = _M.getMousePosition()
|
||||||
downLast = down
|
downLast = down
|
||||||
down = false
|
down = false
|
||||||
for _,btn in ipairs{'l', 'm', 'r'} do
|
for _,btn in ipairs{'l', 'm', 'r'} do
|
||||||
|
@ -103,6 +103,7 @@ _M = {
|
||||||
|
|
||||||
disable = disable,
|
disable = disable,
|
||||||
enable = enable,
|
enable = enable,
|
||||||
|
getMousePosition = love.mouse.getPosition
|
||||||
}
|
}
|
||||||
|
|
||||||
-- metatable provides getters to x, y and down
|
-- metatable provides getters to x, y and down
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue