diff --git a/conf.lua b/conf.lua index 17866d2..bc4d349 100644 --- a/conf.lua +++ b/conf.lua @@ -8,4 +8,6 @@ function love.conf(t) t.window.height = 480 t.window.icon = "res/img/cambridge_icon.png" t.window.vsync = false + t.window.fullscreen = true + t.externalstorage = true end diff --git a/main.lua b/main.lua index 06fb7a3..f5f72f3 100644 --- a/main.lua +++ b/main.lua @@ -4,6 +4,7 @@ if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE")=="1" then end function love.load() + ALIGN_VIEW_RIGHT = 0.5 highscores = {} love.graphics.setDefaultFilter("linear", "nearest") @@ -132,14 +133,12 @@ function love.draw() local height = love.graphics.getHeight() local scale_factor = math.min(width / 640, height / 480) love.graphics.translate( - (width - scale_factor * 640) / 2, - (height - scale_factor * 480) / 2 + (width - scale_factor * 640) * ALIGN_VIEW_RIGHT, + (height - scale_factor * 480) * 0.5 ) love.graphics.scale(scale_factor) scene:render() - if scene.title ~= TouchConfigScene.title then VCTRL.draw() end - if config.gamesettings.display_gamemode == 1 or scene.title == "Title" then love.graphics.setFont(font_3x5_2) love.graphics.setColor(1, 1, 1, 1) @@ -148,6 +147,20 @@ function love.draw() "fps - " .. version, 0, 460, 635, "right" ) end + + if scene.title ~= TouchConfigScene.title then + if ALIGN_VIEW_RIGHT then + love.graphics.push() + love.graphics.origin() + love.graphics.translate( + (width - scale_factor * 640) * 0.5, + (height - scale_factor * 480) * 0.5 + ) + love.graphics.scale(scale_factor) + end + VCTRL.draw() + if ALIGN_VIEW_RIGHT then love.graphics.pop() end + end love.graphics.pop() diff --git a/mobile_libs/touch_settings.lua b/mobile_libs/touch_settings.lua index f205efe..e5478f6 100644 --- a/mobile_libs/touch_settings.lua +++ b/mobile_libs/touch_settings.lua @@ -10,29 +10,29 @@ local _defaultSettings = { ---@type table[] bind = { { - {type='button',x= 1 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'up',iconSize=50}, - {type='button',x= 2 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'down',iconSize=50}, - {type='button',x= 3 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'left',iconSize=50}, - {type='button',x= 4 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'right',iconSize=50}, - {type='button',x= 5 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'menu_decide',iconSize=50}, + {type='button',x= 1 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'up',iconSize=80}, + {type='button',x= 2 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'down',iconSize=80}, + {type='button',x= 3 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'left',iconSize=80}, + {type='button',x= 4 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'right',iconSize=80}, + {type='button',x= 5 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'hold',iconSize=80}, - {type='button',x= 1 * 70 + 120,y = 2 * 70 + 120, r = 30, key= 'rotate_left',iconSize=50}, - {type='button',x= 2 * 70 + 120,y = 2 * 70 + 120, r = 30, key= 'rotate_left2',iconSize=50}, - {type='button',x= 3 * 70 + 120,y = 2 * 70 + 120, r = 30, key= 'rotate_right',iconSize=50}, - {type='button',x= 4 * 70 + 120,y = 2 * 70 + 120, r = 30, key= 'rotate_right2',iconSize=50}, - {type='button',x= 5 * 70 + 120,y = 2 * 70 + 120, r = 30, key= 'retry',iconSize=50}, + {type='button',x= 1 * 70 + 120,y = 2 * 70 + 120, r = 30, key= 'rotate_left',iconSize=80}, + {type='button',x= 2 * 70 + 120,y = 2 * 70 + 120, r = 30, key= 'rotate_left2',iconSize=80}, + {type='button',x= 3 * 70 + 120,y = 2 * 70 + 120, r = 30, key= 'rotate_right',iconSize=80}, + {type='button',x= 4 * 70 + 120,y = 2 * 70 + 120, r = 30, key= 'rotate_right2',iconSize=80}, + {type='button',x= 5 * 70 + 120,y = 2 * 70 + 120, r = 30, key= 'rotate_180',iconSize=80}, - {type='button',x= 1 * 70 + 120,y = 3 * 70 + 120, r = 30, key= '1',iconSize=50}, - {type='button',x= 2 * 70 + 120,y = 3 * 70 + 120, r = 30, key= '2',iconSize=50}, - {type='button',x= 3 * 70 + 120,y = 3 * 70 + 120, r = 30, key= '3',iconSize=50}, - {type='button',x= 4 * 70 + 120,y = 3 * 70 + 120, r = 30, key= '4',iconSize=50}, - {type='button',x= 5 * 70 + 120,y = 3 * 70 + 120, r = 30, key= '5',iconSize=50}, + {type='button',x= 1 * 70 + 120,y = 3 * 70 + 120, r = 30, key= 'menu_decide',iconSize=80}, + -- {type='button',x= 2 * 70 + 120,y = 3 * 70 + 120, r = 30, key= '2',iconSize=80}, + -- {type='button',x= 3 * 70 + 120,y = 3 * 70 + 120, r = 30, key= '3',iconSize=80}, + -- {type='button',x= 4 * 70 + 120,y = 3 * 70 + 120, r = 30, key= '4',iconSize=80}, + {type='button',x= 5 * 70 + 120,y = 3 * 70 + 120, r = 30, key= 'menu_back',iconSize=80}, - -- {type='button',x= 1 * 70 + 120,y = 4 * 70 + 120, r = 30, key= 'up',iconSize=50}, - {type='button',x= 2 * 70 + 120,y = 4 * 70 + 120, r = 30, key='touch_settings',iconSize=50}, - {type='button',x= 3 * 70 + 120,y = 4 * 70 + 120, r = 30, key= 'align_view',iconSize=50}, - {type='button',x= 4 * 70 + 120,y = 4 * 70 + 120, r = 30, key= 'menu_back',iconSize=50}, - -- {type='button',x= 5 * 70 + 120,y = 4 * 70 + 120, r = 30, key= 'up',iconSize=50}, + {type='button',x= 1 * 70 + 120,y = 4 * 70 + 120, r = 30, key= 'delete',iconSize=80}, + {type='button',x= 2 * 70 + 120,y = 4 * 70 + 120, r = 30, key= 'tab',iconSize=80}, + {type='button',x= 3 * 70 + 120,y = 4 * 70 + 120, r = 30, key= 'retry',iconSize=80}, + {type='button',x= 4 * 70 + 120,y = 4 * 70 + 120, r = 30, key= 'align_view',iconSize=80}, + {type='button',x= 5 * 70 + 120,y = 4 * 70 + 120, r = 30, key='touch_settings',iconSize=80}, }, -- 1 { diff --git a/mobile_libs/vctrl.lua b/mobile_libs/vctrl.lua index dcb2649..acf8afc 100644 --- a/mobile_libs/vctrl.lua +++ b/mobile_libs/vctrl.lua @@ -24,6 +24,13 @@ local alternativeRfunction={ ) then scene = TouchConfigScene() end + scene:onInputRelease{input="touch_settings", type="virtual"} + end, + align_view=function() + if scene.title ~= TouchConfigScene.title then + scene:onInputRelease{input="align_view", type="virtual"} + ALIGN_VIEW_RIGHT = ALIGN_VIEW_RIGHT == 1.4 and 0.5 or math.min(ALIGN_VIEW_RIGHT + 0.5,1.4) + end end } @@ -31,18 +38,14 @@ local empty_quad=gc_newQuad(1,1,1,1,1,1) -- A table containing quads used to draw icons for virtual control system. local virtual_quad=setmetatable((function() local t={} - local w=180 - empty_quad=gc_newQuad(0,0,1,1,5*w,7*w) + local w=336 + empty_quad=gc_newQuad(0,0,1,1,5*w,4*w) for i,name in next,{ - 'left','right','up','down','', - 'rotate_right','rotate_left','rotate_180','hold','align_view', - '','','','','', - '1','2','3','4','5', - '','retry','','menu_back','', - 'touch_settings','','','','', - '','','','','menu_decide', - } do if #name>0 then t[name]=gc_newQuad((i-1)%5*w,math.floor((i-1)/5)*w,w,w,5*w,7*w) end end - t.rotate_right2, t.rotate_left2 = t.rotate_right, t.rotate_left + 'left','right','up','down','hold', + 'rotate_left','rotate_left2','rotate_right','rotate_right2','rotate_180', + 'tab','menu_decide','delete','','', + 'retry','align_view','menu_back','','', + } do if #name>0 then t[name]=gc_newQuad((i-1)%5*w,math.floor((i-1)/5)*w,w,w,5*w,4*w) end end return t end)(),{ __index=function() return empty_quad end diff --git a/mobile_libs/vctrlTexture.png b/mobile_libs/vctrlTexture.png index cb09330..4261469 100644 Binary files a/mobile_libs/vctrlTexture.png and b/mobile_libs/vctrlTexture.png differ