背景系统微调,初始强制加载none背景
This commit is contained in:
@@ -1,10 +1,16 @@
|
|||||||
local BGlist={}
|
local BGlist={
|
||||||
|
none={
|
||||||
|
draw=function()
|
||||||
|
love.graphics.clear(.15,.15,.15)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
local BG={
|
local BG={
|
||||||
cur="",
|
cur="none",
|
||||||
init=nil,
|
init=nil,
|
||||||
resize=nil,
|
resize=nil,
|
||||||
update=NULL,
|
update=NULL,
|
||||||
draw=NULL,
|
draw=BGlist.none.draw,
|
||||||
event=nil,
|
event=nil,
|
||||||
discard=NULL,
|
discard=NULL,
|
||||||
}
|
}
|
||||||
@@ -17,8 +23,8 @@ function BG.send(...)
|
|||||||
BG.event(...)
|
BG.event(...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function BG.set(background,force)
|
function BG.set(background)
|
||||||
if background==BG.cur or not(SETTING.bg or force)then return end
|
if background==BG.cur or not SETTING.bg then return end
|
||||||
BG.discard()
|
BG.discard()
|
||||||
background=BGlist[background]
|
background=BGlist[background]
|
||||||
if not background then
|
if not background then
|
||||||
|
|||||||
@@ -477,7 +477,6 @@ function love.run()
|
|||||||
else
|
else
|
||||||
SCN.init("load")
|
SCN.init("load")
|
||||||
end
|
end
|
||||||
BG.set("none",true)
|
|
||||||
|
|
||||||
return function()
|
return function()
|
||||||
local _
|
local _
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
local gc=love.graphics
|
|
||||||
local back={}
|
|
||||||
function back.draw()
|
|
||||||
gc.clear(.15,.15,.15)
|
|
||||||
end
|
|
||||||
return back
|
|
||||||
Reference in New Issue
Block a user