mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Add new callback
This commit is contained in:
17
main.lua
17
main.lua
@@ -39,7 +39,6 @@ function love.load()
|
|||||||
require "settings"
|
require "settings"
|
||||||
|
|
||||||
-- Window stuffs
|
-- Window stuffs
|
||||||
love.mouse.setVisible(false)
|
|
||||||
love.window.setMode(love.graphics.getWidth(), love.graphics.getHeight(), {resizable = true});
|
love.window.setMode(love.graphics.getWidth(), love.graphics.getHeight(), {resizable = true});
|
||||||
love.window.setFullscreen(SETTINGS["fullscreen"])
|
love.window.setFullscreen(SETTINGS["fullscreen"])
|
||||||
|
|
||||||
@@ -117,6 +116,22 @@ function love.draw()
|
|||||||
love.graphics.pop()
|
love.graphics.pop()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function love.mousepressed(x, y, b, _, presses)
|
||||||
|
local x,y=GLOBAL_TRANSFORM:inverseTransformPoint(x,y)
|
||||||
|
SCENE:onInputPress{type = "mouse", x = x, y = y, button = b, presses = presses}
|
||||||
|
end
|
||||||
|
function love.mousereleased(x,y, b, _, presses)
|
||||||
|
local x,y=GLOBAL_TRANSFORM:inverseTransformPoint(x,y)
|
||||||
|
SCENE:onInputRelease{type = "mouse", x = x, y = y, button = b, presses = presses}
|
||||||
|
end
|
||||||
|
function love.mousemoved(x, y, dx, dy)
|
||||||
|
local x,y=GLOBAL_TRANSFORM:inverseTransformPoint(x,y)
|
||||||
|
local dx,dy=GLOBAL_TRANSFORM:inverseTransformPoint(dx,dy)
|
||||||
|
SCENE:onInputMove{type = "mouse", x = x, y = y, dx = dx, dy = dy}
|
||||||
|
end
|
||||||
|
function love.wheelmoved(dx, dy)
|
||||||
|
SCENE:onInputMove{type = "wheel", dx = dx, dy = dy}
|
||||||
|
end
|
||||||
|
|
||||||
function love.touchpressed(id,x,y)
|
function love.touchpressed(id,x,y)
|
||||||
local x,y=GLOBAL_TRANSFORM:inverseTransformPoint(x,y)
|
local x,y=GLOBAL_TRANSFORM:inverseTransformPoint(x,y)
|
||||||
|
|||||||
Reference in New Issue
Block a user