自定义背景拖入无法识别的格式时会提示

This commit is contained in:
MrZ626
2021-11-28 05:20:18 +08:00
parent f8b9f30fd6
commit 73145b4e5e
10 changed files with 31 additions and 14 deletions

View File

@@ -4,10 +4,12 @@ local back={}
local image=false
local alpha=.26
function back.draw()
gc.clear(.1,.1,.1)
gc.setColor(1,1,1,alpha)
local k=math.max(SCR.w/image:getWidth(),SCR.h/image:getHeight())
mDraw(image,SCR.w*.5,SCR.h*.5,nil,k)
if image then
gc.clear(.1,.1,.1)
gc.setColor(1,1,1,alpha)
local k=math.max(SCR.w/image:getWidth(),SCR.h/image:getHeight())
mDraw(image,SCR.w*.5,SCR.h*.5,nil,k)
end
end
function back.event(a,img)
if a then alpha=a end