[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Pygame.sprite ignores transparency?



Wildflower wrote:
The problem is that Pygame.sprite ignores transparency in my sprite images.
I have a PNG image of a simple red ball with anti-aliased edges, drawn in photoshop. If I render this image with an ordinary surface.blit everything looks fine. The edges are anti-aliased and nice.
However, when I try to use pygame.sprite to draw this same image, it gets drawn without any transparency. I use RenderUpdates.draw for the drawing.

Welcome, always good to help new users along.

The pygame sprite classes do nothing with images really. You just assign them as attributes to the Sprite instances, and they get blitted as is.

I am guessing something is happening at load time. The main two questions are what image format are you using, and what type of transparency are you wanting: color key or alpha transparency?

If you have the right format, you should be able to just load the images and use them as is. That isn't always the most optimal, but it should just work.