JoannisO
JoannisO

Reputation: 930

How do I make my sprites have transparent backgrounds in Slick2D?

I've used GIMP to create a sprite using a transparent background. Once I put it in the Image Packer the transparent background disappears and the whole image is messed up. After a bit of googling without finding a single useful thing I decided to use a pink background, but I can't find support for setting a pixel to alpha (I can read the pixel's color though!)

How do I fix this and have a transparent background in my sprite (org.newdawn.slick.Image to be precise)?

Useful links: None as far as I can remember. Took me 45 minutes to jump to this site for help, so there's either pretty much nothing or literally no support.

Upvotes: 0

Views: 1892

Answers (1)

Niklas
Niklas

Reputation: 409

Are you sure the image is saved in a format that supports the transparency? For example JPG does NOT support transparency. PNG does.

Also are you sure that when saving the picture the background is indeed transparent and not white? To double check the background is transparent the majority of image editors will display a grey and white checked grids to show transparency.

Upvotes: 1

Related Questions