|
pygame is
pygame.org is
|
applies_alpha()
applies_alpha() - josmiley (josmiley)Tags:Descriptionnot a project, just a trick
how to applies alpha channel from a surface to another ? surface1 and surface2 must have the same size
from pygame import *
def applies_alpha(surface1,surface2): #return a surface #applies the alpha channel from surface1 to surface2 output = surface2.copy().convert_alpha() surfarray.pixels_alpha(output)[:] = surfarray.array_alpha(surface1)[:] return output
def applies_alpha_ip(surface1,surface2): #applies the alpha channel in place from surface1 to surface2 surfarray.pixels_alpha(surface2)[:] = surfarray.array_alpha(surface1)
LinksScreenshot click to view original size
Releases| applies_alpha() - | - Sep 7, 2010 |
Pygame.org account CommentsIf you wish to leave a comment with your pygame.org account, please sign in first.
|
| spotlight |
|
|
|
| our projects |
|
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
|
|
|
| recent releases |
|
May 22, 2013
May 21, 2013
May 19, 2013
May 18, 2013
May 17, 2013
May 16, 2013
May 15, 2013
May 11, 2013
May 8, 2013
Apr 26, 2013
... more!
|
|