white halo around certain sprites but not others

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
RonanZero
Citizen
Posts: 90
Joined: Mon Oct 20, 2014 3:33 am

white halo around certain sprites but not others

Post by RonanZero »

So every single sprite in my game is fine except one... this is just like any other sprites, nothing special about it but for some reason it has a weird white halo around it. The halo only appears when it's rotated, it looks normal when not rotated. This is what it looks like:
Image
and this is what any other sprite in the game looks like, even when rotated (compared with the other sprite):
Image

Things I've tried so far (that didn't work):
- switching the laser object's sprite to the ship sprite. (the ship sprite still looks fine)
- setting the default image filter to nearest.
- messing around with the files and comparing the images closely.
- flooring the x, y, and rotation.

:?
while true do end;
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: white halo around certain sprites but not others

Post by zorg »

Can you link to the problematic sprite's image file? I'm guessing your image editor blurred the outline's outer edge when you made it transparent... if you did it like that; nevertheless, i'd wager the problem being somewhere around there.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: white halo around certain sprites but not others

Post by micha »

The problem comes from mixing the transparent pixels with the colored pixels. In this case it makes a difference, whether the background is black-transparent (0,0,0,0) or white-transparent (255,255,255,0). To solve the issue, set the background of your image to the same color as the outline of the object and then make it transparent.
User avatar
RonanZero
Citizen
Posts: 90
Joined: Mon Oct 20, 2014 3:33 am

Re: white halo around certain sprites but not others

Post by RonanZero »

The ship's sprite has a white transparent background and it works fine. And as far as I know, Paint.NET doesn't save color data for transparent or non-saturated pixels.
while true do end;
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: white halo around certain sprites but not others

Post by micha »

Could you upload a minimal example .love file, so that we can have a look at it?
User avatar
RonanZero
Citizen
Posts: 90
Joined: Mon Oct 20, 2014 3:33 am

Re: white halo around certain sprites but not others

Post by RonanZero »

while true do end;
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: white halo around certain sprites but not others

Post by micha »

Thanks.

It turned out my initial guess was correct. The red bullet image had "white-transparent" pixels in the background. Here is a .love with the original image and a corrected one (black-transparent).

You can press and hold spacebar to stop rotation.
Attachments
halo.love
(1.27 KiB) Downloaded 59 times
Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests