From 7587d8cafddd759a044ef7ed0a84ea4d21fa2004 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Wed, 3 Mar 2021 16:38:53 +0800 Subject: [PATCH] =?UTF-8?q?IMG=E6=A8=A1=E5=9D=97=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=9B=BE=E7=89=87=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/image.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Zframework/image.lua b/Zframework/image.lua index 921cba5a..4b1fcc87 100644 --- a/Zframework/image.lua +++ b/Zframework/image.lua @@ -12,13 +12,21 @@ function IMG.init(list) local function load(skip) local loaded=0 for k,v in next,list do - IMG[k]=love.graphics.newImage("media/image/"..v) + if type(v)=="string"then + IMG[k]=love.graphics.newImage("media/image/"..v) + else + for i=1,#v do + v[i]=love.graphics.newImage("media/image/"..v[i]) + end + IMG[k]=v + end loaded=loaded+1 if not skip and loaded~=count then coroutine.yield() end end IMG.loadOne=nil + IMG.loadAll=nil end IMG.loadOne=coroutine.wrap(load)