电脑不再默认全屏,增加f11开关全屏功能,整理代码
This commit is contained in:
@@ -217,6 +217,8 @@ function love.keypressed(i)
|
||||
if i=="f8"then
|
||||
devMode=1
|
||||
LOG.print("DEBUG ON",COLOR.yellow)
|
||||
elseif i=="f11"then
|
||||
switchFullscreen()
|
||||
else
|
||||
if SCN.swapping then return end
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ do--setFont
|
||||
end
|
||||
do--upperChar
|
||||
local upper=string.upper
|
||||
upperList={
|
||||
local upperList={
|
||||
["1"]="!",["2"]="@",["3"]="#",["4"]="$",["5"]="%",
|
||||
["6"]="^",["7"]="&",["8"]="*",["9"]="(",["0"]=")",
|
||||
["`"]="~",["-"]="_",["="]="+",
|
||||
|
||||
@@ -9,6 +9,15 @@ local ins,rem=table.insert,table.remove
|
||||
|
||||
|
||||
|
||||
--System
|
||||
function switchFullscreen()
|
||||
SETTING.fullscreen=not SETTING.fullscreen
|
||||
love.window.setFullscreen(SETTING.fullscreen)
|
||||
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
|
||||
end
|
||||
|
||||
|
||||
|
||||
--Encoding Functions
|
||||
--Sep symbol: 33 (!)
|
||||
--Safe char: 34~126
|
||||
|
||||
@@ -290,7 +290,7 @@ SETTING={--Settings
|
||||
warn=true,
|
||||
highCam=false,
|
||||
nextPos=false,
|
||||
fullscreen=true,
|
||||
fullscreen=false,
|
||||
bg=true,
|
||||
powerInfo=false,
|
||||
|
||||
|
||||
@@ -41,12 +41,7 @@ scene.widgetList={
|
||||
WIDGET.newSwitch{name="warn", x=1100, y=300,font=35,disp=lnk_SETval("warn"), code=lnk_SETrev("warn")},
|
||||
WIDGET.newSwitch{name="highCam", x=1100, y=360,font=35,disp=lnk_SETval("highCam"),code=lnk_SETrev("highCam")},
|
||||
WIDGET.newSwitch{name="nextPos", x=1100, y=420,font=35,disp=lnk_SETval("nextPos"),code=lnk_SETrev("nextPos")},
|
||||
WIDGET.newSwitch{name="fullscreen",x=1100, y=480,disp=lnk_SETval("fullscreen"),
|
||||
code=function()
|
||||
SETTING.fullscreen=not SETTING.fullscreen
|
||||
love.window.setFullscreen(SETTING.fullscreen)
|
||||
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
|
||||
end},
|
||||
WIDGET.newSwitch{name="fullscreen",x=1100, y=480,disp=lnk_SETval("fullscreen"), code=switchFullscreen},
|
||||
WIDGET.newSwitch{name="bg", x=1100, y=540,font=35,disp=lnk_SETval("bg"),
|
||||
code=function()
|
||||
BG.set("none")
|
||||
|
||||
Reference in New Issue
Block a user