Добавил простую обработку мыши с учётом масштаба
This commit is contained in:
parent
6e63814184
commit
e629d0ffa4
2 changed files with 58 additions and 0 deletions
|
|
@ -11,6 +11,16 @@ function platform.init()
|
|||
love.graphics.setCanvas() -- Reset the canvas to avoid any bugs
|
||||
love.window.setMode(screenWidth * screenScale, screenHeight * screenScale, { resizable = false, vsync = true })
|
||||
canvas = love.graphics.newCanvas(screenWidth, screenHeight)
|
||||
|
||||
love.handlers.mousemoved = function(x, y, dx, dy, t)
|
||||
if love.mousemoved then return love.mousemoved(x / screenScale, y / screenScale, dx / screenScale, dy / screenScale, t) end
|
||||
end
|
||||
love.handlers.mousepressed = function(x, y, b, t, c)
|
||||
if love.mousepressed then return love.mousepressed(x / screenScale, y / screenScale, b, t, c) end
|
||||
end
|
||||
love.handlers.mousereleased = function(x, y, b, t, c)
|
||||
if love.mousereleased then return love.mousereleased(x / screenScale, y / screenScale, b, t, c) end
|
||||
end
|
||||
end
|
||||
|
||||
function platform.drawStart()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue