[pygame] planes 0.6.0 released

2013-03-05 Thread Florian Berger
Hey,

I have just released v0.6.0 of the planes module.


planes is a hierarchical surface framework for PyGame, extending it
with a hierarchy of mouse-sensitive, draggable Surfaces that can be
used as sprites, windows, icons or other interactive elements.

In addition, the planes.gui module provides basic GUI elements like
container, label, text box, option list and button.

http://florian-berger.de/en/software/planes


Changes:

planes now logs runtime statistics and displays them when F12 is
pressed. There is a font manager class now, and planes comes bundled
with a selection of free fonts for instant use. A font usage example is
included. There is a new widget planes.gui.ProgressBar. All gfx and
font resources are now bundled in a 'resources.zip' file which is
distributed along with planes. planes now uses cx_Freeze to build
executables. Added mouse wheel support for the Plane class and the
PlusMinusBox widget specifically. Optimized Plane.render() a little to
check whether subplanes actually intersect with Display.rect. Bug fixes
and enhancements in Plane.render(), gui.Container.sub(), and
'planes_interactive.py'. Docs update.


planes is quite powerful, but sadly lacks a tutorial to get started.
This will be added in the beta (0.9.x) releases.


planes powers the 2D client of the Fabula engine:
http://fabula-engine.org/


Cheers,
Florian


Re: [pygame] Tone Generator with Pygame, SciKits AudioLab & SciPy - Less laggy method?

2012-11-22 Thread Florian Berger
Hi,

13 Oct 2012 17:29:46 -0400
brian :
>
> Can anyone recommend a faster method for playing sine waves? Perhaps 
> there is a better Audiolab method or different module?

Check out pyo:

https://code.google.com/p/pyo/

I've used it in DSP, it's pretty awesome, and really fast.

Cheers,
Florian


Re: [pygame] (newish?) SVG examples?

2012-02-29 Thread Florian Berger
Hi Jake,

Jake b :
>
> I'm Looking for a vector rendering example, to render .SVG images.
> [...] I'm looking for what code / library to use, ( to prep for
> Pyweek.  )


Might not be quite what you are looking for, but I found a look at the
"Things" source tremendously helpful:

https://savannah.nongnu.org/projects/things/

Cheers,
Florian


-- 
My OpenPGP-Key: http://florian-berger.de/fberger-gpg_key.txt
If you don't know what this is, please ignore the attachment.


signature.asc
Description: PGP signature


Re: [pygame] cx_Freeze and non-BMP images: my possible solution

2012-01-04 Thread Florian Berger
Hi,

Rastagong :
>
> I have been struggling for a while with cx_Freeze to have my Windows
> executables handle PNG images, and more generally non-BMP images.
> [...]
> Does it work for you too?

I have been using Python 3.1, Pygame 1.9.1 and cx_Freeze 4.2.2 on
Win2k for a while now, and I have never had any issues with non-BMP
images. My game engine uses PNG images extensively, and everything
works out of the box here.

Kind regards,
Florian


Re: [pygame] Surface.blit() BLEND_ADD vs. BLEND_RGBA_ADD

2011-12-23 Thread Florian Berger
Hi!

René Dudfield :
>
> Maybe the RGBA_PREMULT of pygame.image.tostring could be used...

It works. Thanks, man! A visual example of the problem and your solution
is at http://pastebin.com/0JJQVYe8 .

Just curious, how bad is the performance penalty for this double
conversion step?

Would it be better to have a BLEND_ADD_PREMULT blit mode instead, i.e.
put the premultiplication in the blitting code?

Kind regards,

Florian


Re: [pygame] Surface.blit() BLEND_ADD vs. BLEND_RGBA_ADD

2011-12-19 Thread Florian Berger

Greg Ewing :
>
> What you need is an image with premultiplied alpha.
> An operation for doing that might be a useful addition.

+1

Is there a feature request tracker for Pygame somewhere?

Regards,
Florian


Re: [pygame] Surface.blit() BLEND_ADD vs. BLEND_RGBA_ADD

2011-12-17 Thread Florian Berger
Hi René!

René Dudfield :
>
> #define BLEND_RGBA_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA)  \
> tmp = dR + sR; dR = (tmp <= 255 ? tmp : 255);   \
> tmp = dG + sG; dG = (tmp <= 255 ? tmp : 255);   \
> tmp = dB + sB; dB = (tmp <= 255 ? tmp : 255);   \
> tmp = dA + sA; dA = (tmp <= 255 ? tmp : 255);

Ah. Intuitively I thought it would multiply the RGB addition by the
alpha, thus adding RGB(0, 0, 0) for fully transparent pixels.
Apparently it is much simpler. :-)

Still, that would be a useful operation for sprite and icon effects. In
my case I use BLEND_ADD to quickly and conveniently highlight a sprite.
Now I will have to mess with the source PNGs to make sure that the RGB
color for fully transparent pixels is actually black.

Regards,
Florian


Re: [pygame] Surface.blit() BLEND_ADD vs. BLEND_RGBA_ADD

2011-12-15 Thread Florian Berger
Hi!

Ian Mallett :
>
> Simply call .convert_alpha() on each surface after you make your
> window.  This clears up most problems.

I am doing that already. In fact I blit the sprite, so I can see that
alpha works; then I create a Surface.copy(), manipulate that and blit
it over the sprite using BLEND_RGBA_ADD.

The result is that the blit incorporates the RGB values of the fully
transparent pixels and adds them as well, resulting in an ugly square
around the sprite.

The solution in my case is to make sure that the transparent pixels
also have a (0, 0, 0) RGB value. But this is annoying. I think this
calls for a bug report. ;-)

Regards,
Florian


[pygame] Surface.blit() BLEND_ADD vs. BLEND_RGBA_ADD

2011-12-15 Thread Florian Berger
Hi,

I am toying around with the above blitting flags. I am blitting a RGBA
sprite surrounded by transparent (i.e. alpha) pixels on a solid RGBA
surface (at least I suppose it is so, both are created from RGBA PNG
images).

In my test setup, there is no difference between BLEND_ADD and
BLEND_RGBA_ADD. I hoped that the latter would honor alpha transparency,
and not add color values of transparent pixels, but this seems not to
be the case. :-/

Has anyone played with this? What is the difference between these two
supposed to be?

Thanks!
Florian


[pygame] fix homebrew install instructions link on pygame.org

2011-12-12 Thread Florian Berger
Hi!

On http://pygame.org/download.shtml, under "Macintosh", there is a link
to "homebrew install instructions" pointing to

https://bitbucket.org/pygame/pygame/issue/82/homebrew-on-leopard-fails-to-install#comment-627494

This should now point to the updated instructions at

https://bitbucket.org/pygame/pygame/issue/82/homebrew-on-leopard-fails-to-install#comment-636765

This one just bit me.

Cheers,
Florian


Re: [pygame] any gentoo people in the house?

2011-09-11 Thread Florian Berger
Hi René,

René Dudfield :
>
> If you could get the gdb stack trace, that might be helpful too.

Hope that is it:

Python 2.6:

...
(gdb) where
#0  0xe424 in __kernel_vsyscall ()
#1  0xb74cfdf0 in raise () from /lib/libc.so.6
#2  0xb74d1628 in abort () from /lib/libc.so.6
#3  0xb750c355 in ?? () from /lib/libc.so.6
#4  0x000e in ?? ()
#5  0xbf98a9c0 in ?? ()
#6  0x0400 in ?? ()
#7  0x in ?? ()


Python 3.2:

...
(gdb) where
#0  0xe424 in __kernel_vsyscall ()
#1  0xb7515df0 in raise () from /lib/libc.so.6
#2  0xb7517628 in abort () from /lib/libc.so.6
#3  0xb7552355 in ?? () from /lib/libc.so.6
#4  0x000d in ?? ()
#5  0xbfd03bb0 in ?? ()
#6  0x0400 in ?? ()
#7  0x in ?? ()

I have no experience in gdb debugging, so I hope that is of some use...

Regards,
Florian


-- 
My OpenPGP-Key: http://florian-berger.de/fberger-gpg_key.txt
If you don't know what this is, please ignore the attachment.


signature.asc
Description: PGP signature


Re: [pygame] any gentoo people in the house?

2011-09-05 Thread Florian Berger
Hi,

René Dudfield :
>
> https://bitbucket.org/pygame/pygame/issue/36/example-fontypy-crashes-with-double-free
> 
> python -m pygame.examples.fonty
> 
> If any gentoo person is able to test this, it would be much
> appreciated!

Confirmed.

$ python2 fonty.py
*** glibc detected *** python2: double free or corruption (out): 0x084da878 ***

$ python3 fonty.py
*** glibc detected *** python3: double free or corruption (out): 0x082d55d0 ***

The complete output is attached for Python 2.6 and Python 3.2.

Tested using Python 2.6.5 and Python 3.2 with pygame-1.9.2_pre3082.ebuild
on Linux 2.6.34, i686.

If you need any additional information or tests, I will be glad to help out.

Regards,
Florian

-- 
My OpenPGP-Key: http://florian-berger.de/fberger-gpg_key.txt
If you don't know what this is, please ignore the attachment.
*** glibc detected *** python2: double free or corruption (out): 0x084da668 ***
=== Backtrace: =
/lib/libc.so.6(+0x6d234)[0xb7526234]
/lib/libc.so.6(+0x6eadb)[0xb7527adb]
/lib/libc.so.6(cfree+0x6d)[0xb752ab0d]
/usr/lib/libSDL_ttf-2.0.so.0(+0x16e4)[0xb6caa6e4]
=== Memory map: 
08048000-08049000 r-xp  08:03 2125846/usr/bin/python2.6
08049000-0804a000 r--p  08:03 2125846/usr/bin/python2.6
0804a000-0804b000 rw-p 1000 08:03 2125846/usr/bin/python2.6
0804b000-084f8000 rw-p  00:00 0  [heap]
b540-b5421000 rw-p  00:00 0 
b5421000-b550 ---p  00:00 0 
b5557000-b555e000 r--s  08:03 1002158
/usr/lib/gconv/gconv-modules.cache
b555e000-b55ad000 rw-s  00:04 2719759/SYSV (deleted)
b55ad000-b55ae000 ---p  00:00 0 
b55ae000-b5dae000 rw-p  00:00 0 
b5dae000-b5db8000 r-xp  08:03 1668225/lib/libnss_files-2.12.2.so
b5db8000-b5db9000 r--p 9000 08:03 1668225/lib/libnss_files-2.12.2.so
b5db9000-b5dba000 rw-p a000 08:03 1668225/lib/libnss_files-2.12.2.so
b5dba000-b5dc3000 r-xp  08:03 1668346/lib/libnss_nis-2.12.2.so
b5dc3000-b5dc4000 r--p 8000 08:03 1668346/lib/libnss_nis-2.12.2.so
b5dc4000-b5dc5000 rw-p 9000 08:03 1668346/lib/libnss_nis-2.12.2.so
b5dc5000-b5dd8000 r-xp  08:03 1668335/lib/libnsl-2.12.2.so
b5dd8000-b5dd9000 r--p 00012000 08:03 1668335/lib/libnsl-2.12.2.so
b5dd9000-b5dda000 rw-p 00013000 08:03 1668335/lib/libnsl-2.12.2.so
b5dda000-b5ddc000 rw-p  00:00 0 
b5ddc000-b5de3000 r-xp  08:03 1668362/lib/libnss_compat-2.12.2.so
b5de3000-b5de4000 r--p 6000 08:03 1668362/lib/libnss_compat-2.12.2.so
b5de4000-b5de5000 rw-p 7000 08:03 1668362/lib/libnss_compat-2.12.2.so
b5de5000-b5dec000 r-xp  08:03 1668226/lib/librt-2.12.2.so
b5dec000-b5ded000 r--p 7000 08:03 1668226/lib/librt-2.12.2.so
b5ded000-b5dee000 rw-p 8000 08:03 1668226/lib/librt-2.12.2.so
b5dee000-b5ea5000 r-xp  08:03 3843048/usr/lib/libasound.so.2.0.0
b5ea5000-b5ea6000 ---p 000b7000 08:03 3843048/usr/lib/libasound.so.2.0.0
b5ea6000-b5ea9000 r--p 000b7000 08:03 3843048/usr/lib/libasound.so.2.0.0
b5ea9000-b5eaa000 rw-p 000ba000 08:03 3843048/usr/lib/libasound.so.2.0.0
b5eaa000-b5eb2000 r-xp  08:03 4499213/usr/lib/libXcursor.so.1.0.2
b5eb2000-b5eb3000 r--p 8000 08:03 4499213/usr/lib/libXcursor.so.1.0.2
b5eb3000-b5eb4000 rw-p 9000 08:03 4499213/usr/lib/libXcursor.so.1.0.2
b5eb4000-b5ebb000 r-xp  08:03 7162214/usr/lib/libXrandr.so.2.2.0
b5ebb000-b5ebc000 r--p 6000 08:03 7162214/usr/lib/libXrandr.so.2.2.0
b5ebc000-b5ebd000 rw-p 7000 08:03 7162214/usr/lib/libXrandr.so.2.2.0
b5ebd000-b5ec5000 r-xp  08:03 4516812/usr/lib/libXrender.so.1.3.0
b5ec5000-b5ec6000 r--p 7000 08:03 4516812/usr/lib/libXrender.so.1.3.0
b5ec6000-b5ec7000 rw-p 8000 08:03 4516812/usr/lib/libXrender.so.1.3.0
b5ecc000-b5edc000 rw-s  00:04 2686985/SYSV0056a4d6 (deleted)
b5edc000-b5eec000 rw-s  00:0b 1391   /dev/snd/pcmC0D0p
b5eec000-b5eed000 ---p  00:00 0 
b5eed000-b66ed000 rw-p  00:00 0 
b66ed000-b66f2000 r-xp  08:03 1292193/usr/lib/libffi.so.5.0.9
b66f2000-b66f3000 r--p 5000 08:03 1292193/usr/lib/libffi.so.5.0.9
b66f3000-b66f4000 rw-p 6000 08:03 1292193/usr/lib/libffi.so.5.0.9
b66f5000-b66f9000 r-xp  08:03 4516524/usr/lib/libXfixes.so.3.1.0
b66f9000-b66fa000 r--p 3000 08:03 4516524/usr/lib/libXfixes.so.3.1.0
b66fa000-b66fb000 rw-p 4000 08:03 4516524/usr/lib/libXfixes.so.3.1.0
b66fb000-b6709000 r-xp  08:03 2617231/usr/lib/libXext.so.6.4.0
b6709000-b670a000 r--p e000 08:03 2617231/usr/lib/libXext.so.6.4.0
b670a000-b670b000 rw-p f000 08:03 2617231/usr/lib/libXext.so.6.4.0
b670b000-b670e000 r-xp  08:03 7114726
/usr/lib/python2.6/lib-dynload/_locale.so
b670e000-b670f000 r--p 2000 08:03 7114726
/usr/lib/python2.6/lib-dynload/_locale.so
b670f000-b671 rw-p 3000 08:03

Re: [pygame] any gentoo people in the house?

2011-09-05 Thread Florian Berger
Hi René,

> If any gentoo person is able to test this, it would be much
> appreciated!

Gentoo user here. I'll check it out.

Regards,
Florian


-- 
My OpenPGP-Key: http://florian-berger.de/fberger-gpg_key.txt
If you don't know what this is, please ignore the attachment.


signature.asc
Description: PGP signature