Update virtual control stuff

This commit is contained in:
SweetSea-ButImNotSweet
2024-04-19 12:53:13 +07:00
parent aefc660dd4
commit cedc6e888e
6 changed files with 96 additions and 81 deletions

View File

@@ -23,7 +23,7 @@ local virtual_quad=setmetatable((function()
empty_quad=gc_newQuad(0,0,1,1,4*w,3*w)
for i,name in next,{
'left','right','up','down',
'rotate_left','rotate_right','rotate_left2','rotate_right2',
'rotate_right','rotate_left','rotate_right2','rotate_left2',
'menu_deicde','','menu_back'
} 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
@@ -134,12 +134,14 @@ function VCTRL.press(x,y,id)
touches[id]=obj
obj:press(x,y,id)
VCTRL.focus=obj
return true
end
end
function VCTRL.release(id)
if touches[id] then
touches[id]:release()
return true
end
touches[id]=nil
end