Page 1 of 1
getting color value by pixel
Posted: Fri Nov 29, 2013 9:52 pm
by fmra
Is there a way in LOVE to return the color values of a single pixel? I'm trying to set collision between a character and map areas (walls) using a bumpmap where black indicates passable areas and white indicates impassable areas.
Re: getting color value by pixel
Posted: Fri Nov 29, 2013 10:01 pm
by Plu
Yeah, you have to create an imageData object from your file first:
http://love2d.org/wiki/love.image.newImageData
That comes with a getPixel() method, which does what you want
Re: getting color value by pixel
Posted: Fri Nov 29, 2013 10:11 pm
by fmra
Fantastic. Thank you
[]
Posted: Sat Nov 30, 2013 3:07 am
by bekey
-snip-