Re: [pygame] question about transparent surfaces and alpha-value

2008-09-24 Thread claudio canepa
sorry, the blit musty be tmp.blit(surf, (0,0), surf.get_rect(), BLEND_RGBA_MULT) -- claxo On Wed, Sep 24, 2008 at 2:58 AM, claudio canepa [EMAIL PROTECTED] wrote: something like: def get_alphaed( surf, alpha): tmp = Pygame.Surface( surf.get_size(), SRCALPHA, 32) tmp.fill(

Re: [pygame] question about transparent surfaces and alpha-value

2008-09-24 Thread kschnee
Hi List, just want to make sure i got this right, please correct me if i'm wrong: if i have a jpg-file, i can set the transparency with the command pygame.Surface.set_alpha(alpha-value). but if i hav a .png-file with already transparent background, i can not set the alpha-value of

Re: [pygame] question about transparent surfaces and alpha-value

2008-09-24 Thread Horst JENS
thanks for the advice, i updated the code at http://www.spielend-programmieren.at/wiki/doku.php?id=code:colordemo1.py -Horst signature.asc Description: Dies ist ein digital signierter Nachrichtenteil

[pygame] question about transparent surfaces and alpha-value

2008-09-23 Thread Horst JENS
Hi List, just want to make sure i got this right, please correct me if i'm wrong: if i have a jpg-file, i can set the transparency with the command pygame.Surface.set_alpha(alpha-value). but if i hav a .png-file with already transparent background, i can not set the alpha-value of that

Re: [pygame] question about transparent surfaces and alpha-value

2008-09-23 Thread claudio canepa
Well, .set_alpha() docs tells that per pixel alpha overrides surface alpha, so you can set the alpha but will have no effect. If you are on pygame 1.8.1, you can blit to a temporary surface with BLEND_MULT flags, the final pixel - channel will go as: tmp = a*b/256 where a.blit(b,.., BLEND_MULT)