Skip to content

Commit 98ff82f

Browse files
committed
Add mousemoved callback.
1 parent fbd43b6 commit 98ff82f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Screen.lua

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ function Screen.new()
6161

6262
function self:mousefocus(focus) end
6363

64+
function self:mousemoved(x, y, dx, dy) end
65+
6466
function self:quit(dquit) end
6567

6668
function self:isActive()

ScreenManager.lua

+11
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,17 @@ function ScreenManager.mousefocus(focus)
234234
ScreenManager.peek():mousefocus(focus);
235235
end
236236

237+
---
238+
-- Callback function triggered when the mouse is moved.
239+
-- @param x - Mouse x position.
240+
-- @param y - Mouse y position.
241+
-- @param dx - The amount moved along the x-axis since the last time love.mousemoved was called.
242+
-- @param dy - The amount moved along the y-axis since the last time love.mousemoved was called.
243+
--
244+
function ScreenManager.mousemoved(x, y, dx, dy)
245+
ScreenManager.peek():mousemoved(x, y, dx, dy);
246+
end
247+
237248
---
238249
-- Reroute the quit callback to the currently active screen.
239250
-- @param dquit

0 commit comments

Comments
 (0)