Changing the brightness of a graphics.draw object?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Changing the brightness of a graphics.draw object?
Just as the title says. Is there a function that I can use to change how bright an image I draw is, or do I have to do that outside of LOVE?
Re: Changing the brightness of a graphics.draw object?
To do that within love you'd need a shader i think.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Changing the brightness of a graphics.draw object?
If you just want to darken it, you can use setColor with a gray color.
Help us help you: attach a .love.
Re: Changing the brightness of a graphics.draw object?
You can use the 'combine' color mode. See love.graphics.setColorMode and ColorMode. If I remember correctly, it does something like this.
So setting a color of (128, 128, 128) means no change. Values above that get added, values below get subtracted.
Sadly, this function will be removed in the next version of LÖVE as we move on the the wondrous world of shaders.
Code: Select all
resulting color = color of texture + (color set with setColor - 128)
Sadly, this function will be removed in the next version of LÖVE as we move on the the wondrous world of shaders.
Shallow indentations.
Re: Changing the brightness of a graphics.draw object?
This worked perfectly, should have thought of it myself. Thanks!Robin wrote:If you just want to darken it, you can use setColor with a gray color.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 15 guests