整理代码,调整大量场景内绘图用的纯白色和纯黑色

This commit is contained in:
MrZ626
2021-08-06 19:16:01 +08:00
parent e6f5723ecc
commit b501cd374b
32 changed files with 91 additions and 90 deletions

View File

@@ -50,7 +50,7 @@ local COLOR={
dMagenta= {0.6, 0.0, 0.6},
dWine= {0.6, 0.0, 0.3},
black= {0.0, 0.0, 0.0},
black= {.05, .05, .05},
dGray= {0.3, 0.3, 0.3},
gray= {0.6, 0.6, 0.6},
lGray= {0.8, 0.8, 0.8},

View File

@@ -97,12 +97,12 @@ local function updatePowerInfo()
gc.rectangle('fill',76,6,pow*.22,14)
if pow<100 then
setFont(15)
gc_setColor(0,0,0)
gc.setColor(COLOR.D)
gc_print(pow,77,1)
gc_print(pow,77,3)
gc_print(pow,79,1)
gc_print(pow,79,3)
gc_setColor(1,1,1)
gc_setColor(COLOR.Z)
gc_print(pow,78,2)
end
end
@@ -657,11 +657,11 @@ function love.run()
gc_line(x,0,x,SCR.h)
gc_line(0,y,SCR.w,y)
local t=int(mx+.5)..","..int(my+.5)
gc_setColor(0,0,0)
gc.setColor(COLOR.D)
gc_print(t,x+1,y)
gc_print(t,x+1,y-1)
gc_print(t,x+2,y-1)
gc_setColor(1,1,1)
gc_setColor(COLOR.Z)
gc_print(t,x+2,y)
gc_replaceTransform(SCR.xOy_dr)

View File

@@ -10,7 +10,7 @@ local SCN={
stat={
tar=false, --Swapping target
style=false,--Swapping style
mid=false, --Loading point
changeTime=false, --Loading point
time=false, --Full swap time
draw=false, --Swap draw func
},
@@ -50,7 +50,7 @@ end
function SCN.swapUpdate()
local S=SCN.stat
S.time=S.time-1
if S.time==S.mid then
if S.time==S.changeTime then
SCN.init(S.tar,SCN.cur)
collectgarbage()
--Scene swapped this moment
@@ -103,36 +103,36 @@ function SCN.pop()
end
local swap={
none={1,0,function()end},--swapTime, changeTime, drawFunction
flash={8,1,function()gc.clear(1,1,1)end},
fade={30,15,function(t)
none={duration=1,changeTime=0,draw=function()end},--swapTime, changeTime, drawFunction
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
gc.setColor(0,0,0,t)
gc.rectangle('fill',0,0,SCR.w,SCR.h)
end},
fade_togame={120,20,function(t)
fade_togame={duration=120,changeTime=20,draw=function(t)
t=t>20 and(120-t)/100 or t/20
gc.setColor(0,0,0,t)
gc.rectangle('fill',0,0,SCR.w,SCR.h)
end},
slowFade={180,90,function(t)
slowFade={duration=180,changeTime=90,draw=function(t)
t=t>90 and 2-t/90 or t/90
gc.setColor(0,0,0,t)
gc.rectangle('fill',0,0,SCR.w,SCR.h)
end},
swipeL={30,15,function(t)
swipeL={duration=30,changeTime=15,draw=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)
swipeR={duration=30,changeTime=15,draw=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)
swipeD={duration=30,changeTime=15,draw=function(t)
t=t/30
gc.setColor(.1,.1,.1,1-abs(t-.5))
t=t*t*(2*t-3)*2+1
@@ -146,8 +146,9 @@ function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back
SCN.swapping=true
local S=SCN.stat
S.tar,S.style=tar,style
local s=swap[style]
S.time,S.mid,S.draw=s[1],s[2],s[3]
S.time=swap[style].duration
S.changeTime=swap[style].changeTime
S.draw=swap[style].draw
end
else
MES.new('warn',"No Scene: "..tar)