local y = 200 first
1
2
3
2
3
x = 100
y = y + y
id = image('gfx/kalis/tank.bmp', x, y, 2)
how to freeimage() with all image name "id"?
i use freeimage(id) but only last image has been removed !
Scripts
FreeImage
FreeImage
1

x = 100
y = y + y
id = image('gfx/kalis/tank.bmp', x, y, 2)
local y=200
local x=100
my_img={}
	for i=1,10 do
		my_img[i] = image('gfx/kalis/tank.bmp', x, y, 2)
		y=y+y
	end
for i=1,10 do 	freeimage(my_img[i]) end
Re: FreeImage
kalis has writtenmy_img[1] my_img[2] my_img[3] ... my_img[8] my_img[9] img_img[10]
imgMngr = {}
imgMngr.dat = {}
imgMngr.add = function (imgID)
				imgMngr.dat[#imgMngr.dat] = imgID
			end
imgMngr.removeAll = function()
					for i = 1, #imgMngr.dat do
						freeimage(imgMngr.dat[i])
					end
					imgMngr.dat = {}
				end
imgMngr.add(image(...)) -- and to free all imgMngr.removeAll()
my_img={}
function add_img(path,x,y,mode)
	table.insert(my_img,image(path,x,y,mode))
end
function free_all() 	for _,key in ipairs(my_img) do 		freeimage(key) 	end end
local y=200
local x=100
	for i=1,10 do
		add_img('gfx/kalis/tank.bmp', x, y, 2)
		y=y+y
	end
free_all()
table.insert(my_img,image(path,x,y,mode))
Re: FreeImage
Re: FreeImageid = {}
id[1] = image()
id[2] = image()
function randomhook()
	for n, w in ipairs(id) do
		freeimage(w)
	end
end
local ct_img = {}
		for i=1,10 do
			ct_img[i] = image("gfx/z_kalis/100_score.bmp", x_img[id], y_img[id], 2)
		end
1
