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

[pygame] Transparent PNGs



Following an old thread: I posted a transparent PNG and said it
mysteriously wouldn't show as transparent. To show the code that gives
that result:

import pygame
import os
pygame.init()
s = pygame.display.set_mode((640,480))
i = pygame.image.load(os.path.join("graphics","Game
Logo.png")).convert_alpha()
s.blit(i,(100,50))
pygame.display.update()

I did do convert_alpha, which I thought would tell Pygame to handle the
transparency data, but it doesn't seem to. I get a logo with white
background, obvious against the black.