10-26-2005, 03:44 PM
|
#1
|
Join Date: Oct 2005
Location: Indiana
Posts: 46
|
LUA Pixel(x, y) Function
Help! I am trying to make a FADE function that fades from one picture to another.
Quote:
function fade(oldimage, newimage)
for fde=1, 255 do
for they=1, 272 do
for thex=1, 480 do
imgpixel=oldimage ixel(t hex, they)
imgprgb=imgpixel:colors()
oimgpixel=newimage ixel( thex, they)
oimgprgb=oimgpixel:colors ()
if imgprgb.r > oimgprgb.r then imgprgb.r=imgprgb.r-1 end
if imgprgb.r < oimgprgb.r then imgprgb.r=imgprgb.r+1 end
if imgprgb.g > oimgprgb.g then imgprgb.g=imgprgb.g-1 end
if imgprgb.g < oimgprgb.g then imgprgb.g=imgprgb.g+1 end
if imgprgb.b > oimgprgb.b then imgprgb.b=imgprgb.b-1 end
if imgprgb.b < oimgprgb.b then imgprgb.b=imgprgb.b+1 end
newpixcolor=Color.new(img prgb.r, imgprgb.g, imgprgb.b)
oldimage ixel(thex, they, newpixcolor)
end
end
screen.flip()
end
end
|
Apparently, there are 2 pixel functions, one that is just a function that sets pixels, with 3 arguments, and one that just gets the color of a pixel, with two arguments.
NOW. When I call this function, it says "An argument was incorrect". I AM using the right number of arguments, and doing everything right (I think). Any help here Please?
Thanks,
Josh
|
|
|