Pygame - calling surface.convert() on animated sprite causes transparent background to become white
Everyone says to use .convert()
on surfaces to speed up animations (which will be an issue with my game because it will be an MMO to some extent, so it might have a dozen or a couple dozen characters moving at the same time), the problem is that my transparent PNG images work great without convert but as soon as I use .convert()
all of the transparent backgrounds suddenly become开发者_如何学编程 white
Do I need to sample the color and make it transparent using color_key?
convert_alpha
should do the trick
http://www.pygame.org/docs/ref/surface.html#Surface.convert_alpha
精彩评论