mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
38 lines
1.1 KiB
Lua
38 lines
1.1 KiB
Lua
local TouchConfigScene = SCENE:extend()
|
|
TouchConfigScene.title = "Touchscreen config\n(you can tap anywhere on touch screen to select this)"
|
|
|
|
local origin_touchPressed, origin_touchReleased, origin_touchMoved
|
|
local function onPressed(id, x, y)
|
|
if not VCTRL.press(x, y, id) then
|
|
-- TODO
|
|
end
|
|
end
|
|
local function onMoved(id, _, _, dx, dy)
|
|
VCTRL.drag(dx, dy, id)
|
|
end
|
|
local function onReleased(id)
|
|
if not VCTRL.release(id) then
|
|
-- TODO
|
|
end
|
|
end
|
|
|
|
function TouchConfigScene:new()
|
|
-- TODO
|
|
-- Temproraily hijacking game's touch-related functions
|
|
origin_touchPressed, origin_touchReleased, origin_touchMoved = love.touchpressed, love.touchreleased, love.touchmoved
|
|
|
|
SETTINGS.input.keys = table.merge(SETTINGS.input.keys, SETTINGS.input.touch)
|
|
end
|
|
function TouchConfigScene:update()
|
|
-- TODO
|
|
end
|
|
|
|
function TouchConfigScene:render()
|
|
MainBackground()
|
|
end
|
|
|
|
function TouchConfigScene:onQuit()
|
|
love.touchpressed, love.touchreleased, love.touchmoved = origin_touchPressed, origin_touchReleased, origin_touchMoved
|
|
end
|
|
|
|
return TouchConfigScene |