Files
Techmino/parts/backgrounds/custom.lua
MrZ626 be54c0e641 关闭背景时亮度可调
新增自定义图片背景功能(可调透明度,目前仅电脑可用)
2021-11-28 03:56:53 +08:00

17 lines
384 B
Lua

--Secret custom background
local gc=love.graphics
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)
end
function back.event(a,img)
if a then alpha=a end
if img then image=img end
end
return back