Hi!
I'm working on making units flash red and white when taking damage. I don't have any problems drawing them red using the alpha blend mode and setColor but I can't figure out how to be able to draw them completely white.
Draw a sprite white
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Draw a sprite white
setColor to white with the default blend mode should work. If that doesn't, please upload your .love so we can do more to help you.
Help us help you: attach a .love.
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: Draw a sprite white
If you use love.graphics.setColor and set it to 255,255,255 then Löve will draw them in their original colors. Try 254,254,254 instead - the difference should not be noticable by the naked eye.
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Re: Draw a sprite white
@ Robin
Thats what love uses as standard and as Germanunkol said there won't be any difference.
@Germanunkol
Sorry, but how would that help?
I've uploaded a small example so you can try it out yourself.
EDIT: Ops failed with the .love, try this one instead.
EDIT2: Okey still failing, OT how do I require files correctly when making .love files?
Thats what love uses as standard and as Germanunkol said there won't be any difference.
@Germanunkol
Sorry, but how would that help?
I've uploaded a small example so you can try it out yourself.
EDIT: Ops failed with the .love, try this one instead.
EDIT2: Okey still failing, OT how do I require files correctly when making .love files?
- Attachments
-
- Animation Tool.love
- (198.92 KiB) Downloaded 181 times
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: Draw a sprite white
Sorry, my remark was nonesense. Setting it to a bright color just makes it display the normal way.
You could just use two images and swap them out?
You could just use two images and swap them out?
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Re: Draw a sprite white
Sometimes requiring files isn't case-sensitive until you zip the files. That was the case with this. You put require "AnAl" when the file is AnAL.
New file with this fixed.
New file with this fixed.
Re: Draw a sprite white
Thanks Qcode!
@Germanunkol, that is a solution, however in this case that would mean double sets of animations which are big on their own. I'm pretty sure you can do it with code.
@Germanunkol, that is a solution, however in this case that would mean double sets of animations which are big on their own. I'm pretty sure you can do it with code.
Re: Draw a sprite white
Nope, i had a similar problem and replace ('Replace color mode. Images (etc) will not be affected by current color.') don't affect images.Gurrlin wrote:Thanks Qcode!
@Germanunkol, that is a solution, however in this case that would mean double sets of animations which are big on their own. I'm pretty sure you can do it with code.
You can do this only via shader (pixeleffect).
Re: Draw a sprite white
You can do it with mapPixel
press "x" for damage
press "x" for damage
- Attachments
-
- Animation Tool.love
- mapPixel
- (199.4 KiB) Downloaded 266 times
Re: Draw a sprite white
Thanks Zeliarden, that's just what I was looking for! I had no idea it existed, time to get some serious feedback implemented!
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 5 guests