forked from 26F-Studio/Zframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimage.lua
More file actions
25 lines (23 loc) · 640 Bytes
/
Copy pathimage.lua
File metadata and controls
25 lines (23 loc) · 640 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
local IMG={}
function IMG.init(list)
IMG.init=nil
setmetatable(IMG,{__index=function(self,name)
if type(list[name])=='table' then
self[name]={}
for k,v in next,list[name] do
self[name][k]=love.graphics.newImage(v)
end
elseif type(list[name])=='string' then
self[name]=love.graphics.newImage(list[name])
else
LOG("No IMG: "..name)
self[name]=PAPER
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