diff --git a/game/vctrl.lua b/game/vctrl.lua index e87f74d..c14edb5 100644 --- a/game/vctrl.lua +++ b/game/vctrl.lua @@ -20,11 +20,15 @@ local empty_quad local virtual_quad=setmetatable((function() local t={} 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,{ - 'left','right','up','down', - 'rotate_right','rotate_left','rotate_right2','rotate_left2', - 'menu_deicde','','menu_back' + 'left','right','up','down','', + 'rotate_right','rotate_left','','','', + '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 return t end)(),{ @@ -51,6 +55,10 @@ function control_type.button:new(data) quad=virtual_quad[data.icon] },self) end +function control_type.button:reset() + self.pressed=false + self.lastPressTime=-1e99 +end function control_type.button:press() self.pressed=true self.lastPressTime=love.timer.getTime() @@ -102,6 +110,12 @@ local global_toggle=false VCTRL={} -- VCTRL.focus=nil -- Focusing buttons +---@param toggle boolean|false +---Enabling virtual control or not +function VCTRL.toggle(toggle) + global_toggle=toggle +end + ---@param ... table ---@class data ---@field type string @@ -163,10 +177,4 @@ function VCTRL.draw(forceLight) VCTRL[i]:draw(forceLight) end end -end - ----@param toggle boolean|false ----Enabling virtual control or not -function VCTRL.toggle(toggle) - global_toggle=toggle end \ No newline at end of file diff --git a/game/vctrlTexture.png b/game/vctrlTexture.png index 85701c0..cb09330 100644 Binary files a/game/vctrlTexture.png and b/game/vctrlTexture.png differ