Posted 11 April 2016 - 03:06 PM
I'm trying to write a function to overlay one picture (using the paintutils.loadImage format, not PAIN) over another, to reduce flickering. Here's what I got so far:
But, it seems to erase all pixels in output that are left of the corresponding pixels in img1. I'm doing this for a game. Help?
Spoiler
Overlays img1 over img2
function mixImages(img1,img2)
local output = img2
for a = 1, #img1 do
if img1[a] then
for b = 1, #img1[a] do
if img1[a] then
if img1[a][b] then
if not output[a] then output[a] = {} end
output[a][b] = img1[a][b]
end
end
end
end
end
return output
end
But, it seems to erase all pixels in output that are left of the corresponding pixels in img1. I'm doing this for a game. Help?