Files
Techmino/Zframework/image.lua
MrZ626 56cbe4c5b6 添加log模块,用于代替之前缺少音频文件弹出的消息框
也给缺少图片和加载错误语言等地方添加了日志
控制台添加log命令输出日志
2021-09-22 11:03:55 +08:00

27 lines
684 B
Lua

local IMG={}
function IMG.init(list)
IMG.init=nil
local null=love.graphics.newCanvas(1,1)
setmetatable(IMG,{__index=function(self,name)
if type(list[name])=='table'then
self[name]={}
for i=1,#list[name]do
self[name][i]=love.graphics.newImage(list[name][i])
end
elseif type(list[name])=='string'then
self[name]=love.graphics.newImage(list[name])
else
LOG("No IMG: "..name)
self[name]=null
end
return self[name]
end})
function IMG.loadAll()
for k in next,list do local _=IMG[k]end
IMG.loadAll=nil
end
end
return IMG