From 5b0f9f1f4d8742280e628471cb7281dbbc12eefd Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 11 Dec 2020 15:11:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=87=BASCR=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=94=B9=E4=B8=BASCR=E6=A8=A1=E5=9D=97=E5=86=85=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/screen.lua | 12 ++++++++++-- parts/scenes/calculator.lua | 8 +------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Zframework/screen.lua b/Zframework/screen.lua index 4549462e..bcc69fc4 100644 --- a/Zframework/screen.lua +++ b/Zframework/screen.lua @@ -1,8 +1,10 @@ local SCR={ w0=1280,h0=720, --Default Screen Size x=0,y=0, --Up-left Coord on screen - w=0,h=0, --Fullscreen w/h in gc - W=0,H=0, --Fullscreen w/h in shader + cx=0,cy=0, --Center Coord on screen (Center X/Y) + ex=0,ey=0, --Down-right Coord on screen (End X/Y) + w=0,h=0, --Fullscreen w/h for graphic functions + W=0,H=0, --Fullscreen w/h for shader safeX=0,safeY=0,--Safe area safeW=0,safeH=0,--Safe area rad=0, --Radius @@ -29,4 +31,10 @@ function SCR.resize(w,h) SCR.safeX,SCR.safeY,SCR.safeW,SCR.safeH=love.window.getSafeArea() SCR.xOy:setTransformation(w/2,h/2,nil,SCR.k,nil,SCR.w0/2,SCR.h0/2) end +function SCR.print() + LOG.print("Screen Info:") + for k,v in next,SCR do + LOG.print(k..": "..v) + end +end return SCR \ No newline at end of file diff --git a/parts/scenes/calculator.lua b/parts/scenes/calculator.lua index a23d9da5..dd5a4186 100644 --- a/parts/scenes/calculator.lua +++ b/parts/scenes/calculator.lua @@ -100,13 +100,7 @@ function scene.keyDown(k) elseif v==114514 or v==1919810 or v==1145141919810 then error() elseif v==670 then - LOG.print("Screen Info:") - LOG.print("x y: "..SCR.x.." "..SCR.y) - LOG.print("w h: "..SCR.w.." "..SCR.h) - LOG.print("W H: "..SCR.W.." "..SCR.H) - LOG.print("k: "..math.floor(SCR.k*100)*.01) - LOG.print("rad: "..math.floor(SCR.rad*100)*.01) - LOG.print("dpi: "..SCR.dpi) + SCR.print() end elseif k=="escape"then val,reg,sym="0"