设置界面左右切换动画调整

This commit is contained in:
MrZ626
2020-09-09 11:48:38 +08:00
parent 963b57a49b
commit b387cdc72d
4 changed files with 22 additions and 10 deletions

View File

@@ -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

View File

@@ -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")}),