mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
update virtual control texture
This commit is contained in:
@@ -20,11 +20,15 @@ local empty_quad
|
|||||||
local virtual_quad=setmetatable((function()
|
local virtual_quad=setmetatable((function()
|
||||||
local t={}
|
local t={}
|
||||||
local w=180
|
local w=180
|
||||||
empty_quad=gc_newQuad(0,0,1,1,4*w,3*w)
|
empty_quad=gc_newQuad(0,0,1,1,5*w,7*w)
|
||||||
for i,name in next,{
|
for i,name in next,{
|
||||||
'left','right','up','down',
|
'left','right','up','down','',
|
||||||
'rotate_right','rotate_left','rotate_right2','rotate_left2',
|
'rotate_right','rotate_left','','','',
|
||||||
'menu_deicde','','menu_back'
|
'menu_deicde','','menu_back','','',
|
||||||
|
'','','','','',
|
||||||
|
'','','back','','',
|
||||||
|
'','','','','',
|
||||||
|
'','','','','select',
|
||||||
} do if #name>0 then t[name]=gc_newQuad((i-1)%4*w,math.floor((i-1)/4)*w,w,w,4*w,3*w) end end -- 4x2 is the size of entire texture
|
} do if #name>0 then t[name]=gc_newQuad((i-1)%4*w,math.floor((i-1)/4)*w,w,w,4*w,3*w) end end -- 4x2 is the size of entire texture
|
||||||
return t
|
return t
|
||||||
end)(),{
|
end)(),{
|
||||||
@@ -51,6 +55,10 @@ function control_type.button:new(data)
|
|||||||
quad=virtual_quad[data.icon]
|
quad=virtual_quad[data.icon]
|
||||||
},self)
|
},self)
|
||||||
end
|
end
|
||||||
|
function control_type.button:reset()
|
||||||
|
self.pressed=false
|
||||||
|
self.lastPressTime=-1e99
|
||||||
|
end
|
||||||
function control_type.button:press()
|
function control_type.button:press()
|
||||||
self.pressed=true
|
self.pressed=true
|
||||||
self.lastPressTime=love.timer.getTime()
|
self.lastPressTime=love.timer.getTime()
|
||||||
@@ -102,6 +110,12 @@ local global_toggle=false
|
|||||||
VCTRL={}
|
VCTRL={}
|
||||||
-- VCTRL.focus=nil -- Focusing buttons
|
-- VCTRL.focus=nil -- Focusing buttons
|
||||||
|
|
||||||
|
---@param toggle boolean|false
|
||||||
|
---Enabling virtual control or not
|
||||||
|
function VCTRL.toggle(toggle)
|
||||||
|
global_toggle=toggle
|
||||||
|
end
|
||||||
|
|
||||||
---@param ... table
|
---@param ... table
|
||||||
---@class data
|
---@class data
|
||||||
---@field type string
|
---@field type string
|
||||||
@@ -164,9 +178,3 @@ function VCTRL.draw(forceLight)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param toggle boolean|false
|
|
||||||
---Enabling virtual control or not
|
|
||||||
function VCTRL.toggle(toggle)
|
|
||||||
global_toggle=toggle
|
|
||||||
end
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 46 KiB |
Reference in New Issue
Block a user