[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Introductions and question about transparency



hello jerome, welcome to the list. wow, it looks like you are off
to a great start. the type of transparancy you are looking for is
named "colorkey transparancy". this means that a given color of the
image is drawn transparantly when blitting.

you say you are loading from XPM images. i'm not sure if XPM images
can store a colorkey value like GIF and PNG can. i'm guessing it does
not, since the image loaders in SDL_image will usually preserve any
transparancy/colorkey values in the image.

what you will want to do is set the colorkey for the "big tile map"
image after it is loaded...

    bigtile_surface = pygame.image.load(tile_filename).convert()
    colorkey = 255, 255, 255
    bigtile_surface.set_colorkey(colorkey)

this should do the job for you. it will make the "white" pixels
transparent when blitting.



your code looks very well put together so far. i look forward to
seeing something playable :]


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org