升级SCR模块,整理大量坐标系变换代码

This commit is contained in:
MrZ626
2021-05-30 02:23:08 +08:00
parent 51d2f43229
commit 9e61505205
20 changed files with 131 additions and 156 deletions

View File

@@ -26,10 +26,9 @@ function scene.draw()
--Gray screen cover
gc.setColor(.15,.15,.15,timer*1.26)
gc.push('transform')
gc.origin()
gc.rectangle('fill',0,0,SCR.w,SCR.h)
gc.pop()
gc.replaceTransform(SCR.origin)
gc.rectangle('fill',0,0,SCR.w,SCR.h)
gc.replaceTransform(SCR.xOy)
--Pie counter
gc.setColor(1,1,1,4*(1-timer))

View File

@@ -53,13 +53,13 @@ function scene.draw()
local t=t1-i*15
if t>0 then
gc.push('transform')
gc.setColor(1,1,1,min(t*.025,1))
titleTransform[animeType[i]](t,i)
local dt=(t1+62-5*i)%300
if dt<20 then
gc.translate(0,math.abs(10-dt)-10)
end
gc.polygon('line',L[i])
gc.setColor(1,1,1,min(t*.025,1))
titleTransform[animeType[i]](t,i)
local dt=(t1+62-5*i)%300
if dt<20 then
gc.translate(0,math.abs(10-dt)-10)
end
gc.polygon('line',L[i])
gc.pop()
end
end

View File

@@ -373,11 +373,10 @@ function scene.draw()
--Black screen
if blackTime>0 or openTime>3 then
gc.push('transform')
gc.origin()
gc.replaceTransform(SCR.origin)
gc.setColor(0,0,0,blackTime+(openTime-3)*4)
gc.rectangle('fill',0,0,SCR.w,SCR.h)
gc.pop()
gc.replaceTransform(SCR.xOy)
end
gc.pop()
end

View File

@@ -174,10 +174,9 @@ function scene.draw()
local _=T
if GAME.result then _=_*.7 end
gc.setColor(.15,.15,.15,_)
gc.push('transform')
gc.origin()
gc.rectangle('fill',0,0,SCR.w,SCR.h)
gc.pop()
gc.replaceTransform(SCR.origin)
gc.rectangle('fill',0,0,SCR.w,SCR.h)
gc.replaceTransform(SCR.xOy)
--Pause Info
setFont(25)

View File

@@ -77,8 +77,7 @@ function scene.update(dt)
end
function scene.draw()
gc.push('transform')
gc.origin()
gc.replaceTransform(SCR.origin)
for i=1,#names do
local N=names[i]
if type(N.color)=='table'then
@@ -88,7 +87,7 @@ function scene.draw()
end
gc.draw(N.text,N.x,N.y)
end
gc.pop()
gc.replaceTransform(SCR.xOy)
gc.setColor(1,1,1)
local T=40*math.min(time,45)