From b387cdc72dee86ce7b0d947dfa94dc3ae6d5c040 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Wed, 9 Sep 2020 11:48:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=B7=A6?= =?UTF-8?q?=E5=8F=B3=E5=88=87=E6=8D=A2=E5=8A=A8=E7=94=BB=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/scene.lua | 14 +++++++++++++- Zframework/widgetList.lua | 12 ++++++------ parts/gametoolfunc.lua | 2 +- parts/scenes.lua | 4 ++-- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Zframework/scene.lua b/Zframework/scene.lua index 23f7ef86..14ffd929 100644 --- a/Zframework/scene.lua +++ b/Zframework/scene.lua @@ -66,12 +66,24 @@ local swap={ gc.setColor(0,0,0,t) gc.rectangle("fill",0,0,scr.w,scr.h) end}, - swipe={30,15,function(t) + swipeL={30,15,function(t) t=t/30 gc.setColor(.1,.1,.1,1-abs(t-.5)) t=t*t*(3-2*t)*2-1 gc.rectangle("fill",t*scr.w,0,scr.w,scr.h) end}, + swipeR={30,15,function(t) + t=t/30 + gc.setColor(.1,.1,.1,1-abs(t-.5)) + t=t*t*(2*t-3)*2+1 + gc.rectangle("fill",t*scr.w,0,scr.w,scr.h) + end}, + swipeD={30,15,function(t) + t=t/30 + gc.setColor(.1,.1,.1,1-abs(t-.5)) + t=t*t*(2*t-3)*2+1 + gc.rectangle("fill",0,t*scr.h,scr.w,scr.h) + end}, }--Scene swapping animations function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back local S=SCN.stat diff --git a/Zframework/widgetList.lua b/Zframework/widgetList.lua index fb90e89b..393f79a2 100644 --- a/Zframework/widgetList.lua +++ b/Zframework/widgetList.lua @@ -241,8 +241,8 @@ local Widgets={ newButton({name="quit", x=640, y=600, w=240,h=100,color="white", font=35,code=BACK}), }, setting_game={ - newButton({name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_video","swipe")end}), - newButton({name="sound", x=1080, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_sound","swipe")end}), + newButton({name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_video","swipeR")end}), + newButton({name="sound", x=1080, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_sound","swipeL")end}), newButton({name="ctrl", x=290, y=220, w=320,h=80, color="lYellow",font=35,code=goScene("setting_control")}), newButton({name="key", x=640, y=220, w=320,h=80, color="lGreen", font=35,code=goScene("setting_key")}), newButton({name="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=goScene("setting_touch")}), @@ -258,8 +258,8 @@ local Widgets={ newButton({name="back", x=1140, y=640, w=180,h=80,color="white", font=35,code=BACK}), }, setting_video={ - newButton({name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_sound","swipe")end}), - newButton({name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game","swipe")end}), + newButton({name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_sound","swipeR")end}), + newButton({name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game","swipeL")end}), newSlider({name="ghost", x=250, y=180,w=200,unit=.6,font=35,disp=SETval("ghost"),show="percent",code=SETsto("ghost")}), newSlider({name="center", x=620, y=180,w=200,unit=1, font=35,disp=SETval("center"), code=SETsto("center")}), newSwitch({name="smooth", x=260, y=260, font=25,disp=SETval("smooth"), code=SETrev("smooth")}), @@ -299,8 +299,8 @@ local Widgets={ newButton({name="back", x=1140, y=640,w=180,h=80,color="white", font=35,code=BACK}), }, setting_sound={ - newButton({name="game", x=200, y=80,w=240,h=80,color="lCyan", font=35,code=function()SCN.swapTo("setting_game","swipe")end}), - newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan", font=35,code=function()SCN.swapTo("setting_video","swipe")end}), + newButton({name="game", x=200, y=80,w=240,h=80,color="lCyan", font=35,code=function()SCN.swapTo("setting_game","swipeR")end}), + newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan", font=35,code=function()SCN.swapTo("setting_video","swipeL")end}), newSlider({name="sfx", x=180, y=200,w=400, font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}), newSlider({name="stereo", x=180, y=500,w=400, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end,disp=SETval("stereo"),code=SETsto("stereo"),hide=function()return setting.sfx==0 end}), newSlider({name="spawn", x=180, y=300,w=400, font=30,change=function()SFX.fplay("spawn_"..rnd(7),setting.spawn)end,disp=SETval("spawn"), code=SETsto("spawn")}), diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index a9186d39..4df86610 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -287,7 +287,7 @@ function loadGame(M,ifQuickPlay) drawableText.modeName:set(text.modes[M][1]) drawableText.levelName:set(text.modes[M][2]) needResetGameData=true - SCN.swapTo("play",ifQuickPlay and"swipe"or"fade_togame") + SCN.swapTo("play",ifQuickPlay and"swipeD"or"fade_togame") SFX.play("enter") end function resetGameData() diff --git a/parts/scenes.lua b/parts/scenes.lua index f0a0c3a2..c1e70947 100644 --- a/parts/scenes.lua +++ b/parts/scenes.lua @@ -1275,7 +1275,7 @@ do--custom elseif key=="q"then SCN.go("sequence") elseif key=="e"then - SCN.swapTo("draw","swipe") + SCN.swapTo("draw","swipeL") elseif #key==1 then local T=tonumber(key) if T and T>=1 and T<=5 then @@ -1497,7 +1497,7 @@ do--draw preField[sy][sx]=pen end elseif key=="e"then - SCN.swapTo("custom","swipe") + SCN.swapTo("custom","swipeL") elseif key=="escape"then SCN.back() elseif key=="k"then