Have you any idea how to make window transparent using pygame?

K

kishkin

Hello everybody!

I just want to make window transparent. ;) At this moment I've found
only ideas of taking screenshots to make background... Anything else?

Thanks for help!
 
T

Terry Hancock

I just want to make window transparent. ;) At this moment
I've found only ideas of taking screenshots to make
background... Anything else?

You are looking for "alpha" surfaces. In a full RGBA
surface, the "A" or "alpha" represents the degree of
transparency of the surface for each pixel. There is also
such a thing as a per-surface alpha, etc.

The documentation can be had from the PyGame website at
http://www.pygame.org. You will also find a link to a
PyGame-specific mailing list, which is really the best place
to ask about this sort of thing.
 
D

Diez B. Roggisch

Terry said:
You are looking for "alpha" surfaces. In a full RGBA
surface, the "A" or "alpha" represents the degree of
transparency of the surface for each pixel. There is also
such a thing as a per-surface alpha, etc.

The documentation can be had from the PyGame website at
http://www.pygame.org. You will also find a link to a
PyGame-specific mailing list, which is really the best place
to ask about this sort of thing.

That alone won't help. First of all, the alpha only is applied to the
contents of the pygame window - so you need to capture the background
behind that first and put it in the window as background. But if that
background changes, you won't be notified.

But that still won't rid you of the window decorations...
I guess one could do that with OS-specific calls to window-handles or
the like (and in PyObjc its a no-brainer, as the Mac windowing-system
supports that natively)

But in pygame, there is no API for that.

Regards,

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top