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

Re: [pygame] Determining per-pixel alpha



Lee Harr wrote:
How can I tell if a surface has per-pixel alpha?
The easiest way is to see if the pixel data has an alpha mask. If that doesn't make much sense, just trust that this code works.


def does_surface_have_pixel_alpha(surface):
return surface.get_masks()[3] != 0