Update stuffs
This commit is contained in:
2
conf.lua
2
conf.lua
@@ -8,4 +8,6 @@ function love.conf(t)
|
|||||||
t.window.height = 480
|
t.window.height = 480
|
||||||
t.window.icon = "res/img/cambridge_icon.png"
|
t.window.icon = "res/img/cambridge_icon.png"
|
||||||
t.window.vsync = false
|
t.window.vsync = false
|
||||||
|
t.window.fullscreen = true
|
||||||
|
t.externalstorage = true
|
||||||
end
|
end
|
||||||
|
|||||||
21
main.lua
21
main.lua
@@ -4,6 +4,7 @@ if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE")=="1" then
|
|||||||
end
|
end
|
||||||
|
|
||||||
function love.load()
|
function love.load()
|
||||||
|
ALIGN_VIEW_RIGHT = 0.5
|
||||||
highscores = {}
|
highscores = {}
|
||||||
love.graphics.setDefaultFilter("linear", "nearest")
|
love.graphics.setDefaultFilter("linear", "nearest")
|
||||||
|
|
||||||
@@ -132,14 +133,12 @@ function love.draw()
|
|||||||
local height = love.graphics.getHeight()
|
local height = love.graphics.getHeight()
|
||||||
local scale_factor = math.min(width / 640, height / 480)
|
local scale_factor = math.min(width / 640, height / 480)
|
||||||
love.graphics.translate(
|
love.graphics.translate(
|
||||||
(width - scale_factor * 640) / 2,
|
(width - scale_factor * 640) * ALIGN_VIEW_RIGHT,
|
||||||
(height - scale_factor * 480) / 2
|
(height - scale_factor * 480) * 0.5
|
||||||
)
|
)
|
||||||
love.graphics.scale(scale_factor)
|
love.graphics.scale(scale_factor)
|
||||||
|
|
||||||
scene:render()
|
scene:render()
|
||||||
if scene.title ~= TouchConfigScene.title then VCTRL.draw() end
|
|
||||||
|
|
||||||
if config.gamesettings.display_gamemode == 1 or scene.title == "Title" then
|
if config.gamesettings.display_gamemode == 1 or scene.title == "Title" then
|
||||||
love.graphics.setFont(font_3x5_2)
|
love.graphics.setFont(font_3x5_2)
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
@@ -148,6 +147,20 @@ function love.draw()
|
|||||||
"fps - " .. version, 0, 460, 635, "right"
|
"fps - " .. version, 0, 460, 635, "right"
|
||||||
)
|
)
|
||||||
end
|
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()
|
love.graphics.pop()
|
||||||
|
|
||||||
|
|||||||
@@ -10,29 +10,29 @@ local _defaultSettings = {
|
|||||||
---@type table<string,string>[]
|
---@type table<string,string>[]
|
||||||
bind = {
|
bind = {
|
||||||
{
|
{
|
||||||
{type='button',x= 1 * 70 + 120,y = 1 * 70 + 120, r = 30, key= 'up',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=50},
|
{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=50},
|
{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=50},
|
{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= 'menu_decide',iconSize=50},
|
{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= 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=50},
|
{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=50},
|
{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=50},
|
{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= 'retry',iconSize=50},
|
{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= 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=50},
|
-- {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=50},
|
-- {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=50},
|
-- {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= '5',iconSize=50},
|
{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= 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='touch_settings',iconSize=50},
|
{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= 'align_view',iconSize=50},
|
{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= 'menu_back',iconSize=50},
|
{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= 'up',iconSize=50},
|
{type='button',x= 5 * 70 + 120,y = 4 * 70 + 120, r = 30, key='touch_settings',iconSize=80},
|
||||||
|
|
||||||
}, -- 1
|
}, -- 1
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ local alternativeRfunction={
|
|||||||
) then
|
) then
|
||||||
scene = TouchConfigScene()
|
scene = TouchConfigScene()
|
||||||
end
|
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
|
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.
|
-- A table containing quads used to draw icons for virtual control system.
|
||||||
local virtual_quad=setmetatable((function()
|
local virtual_quad=setmetatable((function()
|
||||||
local t={}
|
local t={}
|
||||||
local w=180
|
local w=336
|
||||||
empty_quad=gc_newQuad(0,0,1,1,5*w,7*w)
|
empty_quad=gc_newQuad(0,0,1,1,5*w,4*w)
|
||||||
for i,name in next,{
|
for i,name in next,{
|
||||||
'left','right','up','down','',
|
'left','right','up','down','hold',
|
||||||
'rotate_right','rotate_left','rotate_180','hold','align_view',
|
'rotate_left','rotate_left2','rotate_right','rotate_right2','rotate_180',
|
||||||
'','','','','',
|
'tab','menu_decide','delete','','',
|
||||||
'1','2','3','4','5',
|
'retry','align_view','menu_back','','',
|
||||||
'','retry','','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
|
||||||
'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
|
|
||||||
return t
|
return t
|
||||||
end)(),{
|
end)(),{
|
||||||
__index=function() return empty_quad end
|
__index=function() return empty_quad end
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 182 KiB |
Reference in New Issue
Block a user