From 6ced3487347fc97dda68287b06e842f62ef40c25 Mon Sep 17 00:00:00 2001 From: MrZ_26 Date: Mon, 3 Aug 2020 16:15:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=BF=87=E5=9C=BA=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/scene.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Zframework/scene.lua b/Zframework/scene.lua index cba5f16b..df6cca31 100644 --- a/Zframework/scene.lua +++ b/Zframework/scene.lua @@ -376,6 +376,15 @@ local swap={ gc.setColor(0,0,0,t) gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi) end}, + swipe={30,15,function(t) + gc.setColor(0,0,0,1-abs(t-15)/15) + if t>15 then + t=t/15-1 + gc.rectangle("fill",scr.w*scr.dpi,0,-scr.w*scr.dpi*(1-t),scr.h*scr.dpi) + else + gc.rectangle("fill",0,0,scr.w*scr.dpi*t/15,scr.h*scr.dpi) + end + end}, }--Scene swapping animations function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back local S=SCN.swap