Hi there,
is tehre a way to set or change the opacity of an image?
Opacity
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Opacity
I don't know for sure, but I guess when you set love.color_modulate you can just use setColor. (if you don't understand this I'd suggest reading the docs)
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Opacity
I don't know if it's possible to change opacity with LÖVE. I just set the opacity in the .png-images that I load. (For example as with http://love2d.org/forum/viewtopic.php?f ... t=10#p5797.)
Help us help you: attach a .love.
Re: Opacity
I mean there ust be the possibility changing the overal opacity of a loaded image.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Opacity
Compositing isn't possible (yet), but what I posted should work.
Re: Opacity
Use color modulation:Sparx wrote:I mean there ust be the possibility changing the overal opacity of a loaded image.
Code: Select all
image = love.graphics.newImage("banana.jpg")
love.graphics.setColorMode(love.color_modulate)
love.graphics.setColor(255, 255, 255, 50) -- red, green, blue, opacity (this would be white with 20% opacity)
love.graphics.draw(image, 400, 300)
Now posting IN STEREO (where available)
Re: Opacity
Thanks for the solution Mike, I was scratching my head for ages trying to work this one out.. Im slightly bald in one spot now!
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Opacity
And this wasn't the same I said?
Re: Opacity
It definatley is. But a Problem is that in this specific solution i need to set these opacity settings each time I draw an image. Is there a way of saving the once modulated image to a new Image?
Re: Opacity
Not yet but you can still make a function out of the above to call it each time you're drawing.Sparx wrote:It definatley is. But a Problem is that in this specific solution i need to set these opacity settings each time I draw an image. Is there a way of saving the once modulated image to a new Image?
Who is online
Users browsing this forum: No registered users and 3 guests