473,394 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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!

Jan 30 '06 #1
2 4494
On 30 Jan 2006 08:52:04 -0800
"kishkin" <ki*****@gmail.com> wrote:
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.

--
Terry Hancock (ha*****@AnansiSpaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com

Jan 30 '06 #2
Terry Hancock schrieb:
On 30 Jan 2006 08:52:04 -0800
"kishkin" <ki*****@gmail.com> wrote:
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.


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
Jan 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Marian Aldenhövel | last post by:
Hi, I am trying to make pygame play music on windows. This simple program: import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels",...
0
by: Never Best | last post by:
hello, I was curious if someone here could help... I basically want to put a transparent window infront of a fullscreen application and keep drawing text onto the transparent window (basically...
23
by: Skipper | last post by:
Hi All, I am going to try and learn Python because I want to write at least one program to help my disabled son with communitation. I am not asking for anyone to do this for me I simply want...
1
by: yuban | last post by:
I am trying ( so far in vain ) to display a normal looking ( non-transparent ) control in a transparent window. I am attempting this in C++, on Vista ( argh ), and having no luck at all. Our...
0
by: Grant Edwards | last post by:
I've got a system where I try to install extensions using /usr/local/bin/python setup.py install But, it fails when it tries to use a non-existant compiler path and specs file. I suspect it's...
1
by: joshuabraham | last post by:
os version =windows xp hi guys i'm having problems using pygame the following code just does not seem to work. clock=pygame.time.Clock() while True: sound1.play() clock.tick(60) ...
3
by: globalrev | last post by:
im doing this : http://www.learningpython.com/2006/03/12/creating-a-game-in-python-using-pygame-part-one/ and when closing the program the window stays up and doesnt respond. i tried adding...
11
by: globalrev | last post by:
http://www.pygame.org/docs/ref/mixer.html import pygame #pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=3072) //it complained abiout words= so i guess its only the nbrs...
5
by: defn noob | last post by:
Im using PyGame to draw images of graphs and trees. Howver right now i am looping using: while 1: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.