From c37370a50ac4bfeefd60de0786280a56f9f85ac6 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Wed, 11 Aug 2021 16:17:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/scene.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Zframework/scene.lua b/Zframework/scene.lua index 2928e386..367ff5e5 100644 --- a/Zframework/scene.lua +++ b/Zframework/scene.lua @@ -51,8 +51,8 @@ function SCN.swapUpdate() local S=SCN.stat S.time=S.time-1 if S.time==S.changeTime then - SCN.init(S.tar,SCN.cur) --Scene swapped this moment + SCN.init(S.tar,SCN.cur) end if S.time==0 then SCN.swapping=false @@ -68,17 +68,15 @@ function SCN.init(s,org) WIDGET.setWidgetList(S.widgetList) SCN.sceneInit=S.sceneInit SCN.sceneBack=S.sceneBack - SCN.update=S.update - SCN.draw=S.draw - SCN.mouseClick=S.mouseClick - SCN.touchClick=S.touchClick SCN.mouseDown=S.mouseDown SCN.mouseMove=S.mouseMove SCN.mouseUp=S.mouseUp + SCN.mouseClick=S.mouseClick SCN.wheelMoved=S.wheelMoved SCN.touchDown=S.touchDown SCN.touchUp=S.touchUp SCN.touchMove=S.touchMove + SCN.touchClick=S.touchClick SCN.keyDown=S.keyDown SCN.keyUp=S.keyUp SCN.gamepadDown=S.gamepadDown @@ -87,6 +85,8 @@ function SCN.init(s,org) SCN.directoryDropped=S.directoryDropped SCN.resize=S.resize SCN.socketRead=S.socketRead + SCN.update=S.update + SCN.draw=S.draw if S.sceneInit then S.sceneInit(org)end end function SCN.push(tar,style) @@ -97,12 +97,12 @@ function SCN.push(tar,style) end end function SCN.pop() - local _=SCN.stack - _[#_],_[#_-1]=nil + local s=SCN.stack + s[#s],s[#s-1]=nil end local swap={ - none={duration=1,changeTime=0,draw=function()end},--swapTime, changeTime, drawFunction + none={duration=1,changeTime=0,draw=function()end}, flash={duration=8,changeTime=1,draw=function()gc.clear(1,1,1)end}, fade={duration=30,changeTime=15,draw=function(t) t=t>15 and 2-t/15 or t/15