Hello. I'm thinking about doing a puzzle game, but one of the key things I need to make the presentation correct is allow color masking on all drawn objects, to simulate the user putting red goggles, green goggles, blue goggles, etc. thus giving everything a tint of the proper color when the proper glasses are being worn.
I checked through the documentation but couldn't seem to find anything to do that, unless one of the blending modes could help me, but the documentation regarding that functionality is somewhat sparse. If there's a way to do it at the rendered screen level too, that's fine, but again I didn't see anything indicating post-processing of this sort is doable at this point.
Thanks for your help!
Color masking possible?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Color masking possible?
love.graphics.setColorMode(love.color_modulate) --see http://love2d.org/docs/Constants.html for the values of things like colormode
love.graphics.setColor(255,200,200) --slightly red color
love.graphics.draw(image,100,100) --image will now be drawn with a red tint (rather, the green and blue values of the image will be lessened)
That allows for tinting when drawing images, you still have to set colors before you draw stuff to make it the right color. The alternate solution is, of course, to just draw a massive transparent rectangle in front of everything.
love.graphics.setColor(255,0,0,32) --transparent red
love.graphics.rectangle(love.draw_fill,0,0,love.graphics.getWidth(),love.graphics.getHeight())
love.graphics.setColor(255,200,200) --slightly red color
love.graphics.draw(image,100,100) --image will now be drawn with a red tint (rather, the green and blue values of the image will be lessened)
That allows for tinting when drawing images, you still have to set colors before you draw stuff to make it the right color. The alternate solution is, of course, to just draw a massive transparent rectangle in front of everything.
love.graphics.setColor(255,0,0,32) --transparent red
love.graphics.rectangle(love.draw_fill,0,0,love.graphics.getWidth(),love.graphics.getHeight())
Re: Color masking possible?
Perfect! Thank you so much!
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 9 guests