mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
TEST
This commit is contained in:
@@ -237,18 +237,16 @@ end
|
|||||||
---@param list table<BUTTON.button>
|
---@param list table<BUTTON.button>
|
||||||
---@param x number # Mouse position
|
---@param x number # Mouse position
|
||||||
---@param y number # Mouse position
|
---@param y number # Mouse position
|
||||||
---@param isMouse? boolean # Is mouse just released a button?
|
function BUTTON.press(list, x, y)
|
||||||
function BUTTON.press(list, x, y, isMouse)
|
for _, v in pairs(list) do v:press(x, y) end
|
||||||
for _, v in pairs(list) do v:press(x, y, isMouse) end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---Trigger the release action
|
---Trigger the release action
|
||||||
---@param list table<BUTTON.button>
|
---@param list table<BUTTON.button>
|
||||||
---@param x number # Mouse position
|
---@param x number # Mouse position
|
||||||
---@param y number # Mouse position
|
---@param y number # Mouse position
|
||||||
---@param isMouse? boolean # Is mouse just released a button?
|
function BUTTON.release(list, x, y)
|
||||||
function BUTTON.release(list, x, y, isMouse)
|
for _, v in pairs(list) do v:release(x, y) end
|
||||||
for _, v in pairs(list) do v:release(x, y, isMouse) end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return BUTTON
|
return BUTTON
|
||||||
@@ -77,13 +77,13 @@ end
|
|||||||
function TouchConfigScene:onInputPress(e)
|
function TouchConfigScene:onInputPress(e)
|
||||||
if e.input == 'menu_back' then SCENE = InputConfigScene() end
|
if e.input == 'menu_back' then SCENE = InputConfigScene() end
|
||||||
if e.type == "mouse" or e.type == "touch" then
|
if e.type == "mouse" or e.type == "touch" then
|
||||||
BUTTON.press(buttonList, e.x, e.y, e.type == "touch")
|
BUTTON.press(buttonList, e.x, e.y)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
---@param e SCENE_onInput
|
---@param e SCENE_onInput
|
||||||
function TouchConfigScene:onInputRelease(e)
|
function TouchConfigScene:onInputRelease(e)
|
||||||
if e.type == "mouse" or e.type == "touch" then
|
if e.type == "mouse" or e.type == "touch" then
|
||||||
BUTTON.release(buttonList, e.x, e.y, e.type == "touch")
|
BUTTON.release(buttonList, e.x, e.y)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user