Is there any way to make translucent sprites in Love2d?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Party member
- Posts: 355
- Joined: Wed Jul 03, 2013 4:06 am
Is there any way to make translucent sprites in Love2d?
You know, partially see through ones...like a ghost, etc. I want to use this mainly for a fog effect....
- CaptainMaelstrom
- Party member
- Posts: 161
- Joined: Sat Jan 05, 2013 10:38 pm
Re: Is there any way to make translucent sprites in Love2d?
love.graphics.setColor(255,255,255,127)
love.graphics.draw(yourSprite,50,50)
The 127, the fourth parameter in setColor is the alpha parameter which makes things translucent. 255 is opaque, 0 is completely invisible.
love.graphics.draw(yourSprite,50,50)
The 127, the fourth parameter in setColor is the alpha parameter which makes things translucent. 255 is opaque, 0 is completely invisible.
-
- Party member
- Posts: 355
- Joined: Wed Jul 03, 2013 4:06 am
Re: Is there any way to make translucent sprites in Love2d?
Hmm. Tried that earlier, but didn't seem to work. Might be a variable not being set. Will try again, thanks!
-
- Party member
- Posts: 355
- Joined: Wed Jul 03, 2013 4:06 am
Re: Is there any way to make translucent sprites in Love2d?
Yeah, forced it to a certain value rather than using a variable being called from another function- it worked. So, thanks
Re: Is there any way to make translucent sprites in Love2d?
Not that it's related, but what you mean is transparent and not translucent. Transparent objects would partially blend their own color to background color, while translucent objects only alter background color by subtracting some amount of light from it, they don't have their own color. Latter is acheivable, too, through "multiplication" blend mode.
Who is online
Users browsing this forum: Google [Bot] and 54 guests