not 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 *
#return a surface
#applies the alpha channel from surface1 to surface2
output = surface2.copy().convert_alpha()
surfarray.pixels_alpha(output)[:] = surfarray.array_alpha(surface1)[:]
#applies the alpha channel in place from surface1 to surface2
surfarray.pixels_alpha(surface2)[:] = surfarray.array_alpha(surface1)
click to view original size
|applies_alpha() - ||- Sep 7, 2010|
Pygame.org account Comments
If you wish to leave a comment with your pygame.org account, please sign in first.
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
Apr 21, 2014
Apr 19, 2014
Apr 16, 2014
Apr 13, 2014
Apr 9, 2014
Mar 18, 2014
Mar 15, 2014
Mar 14, 2014
Mar 13, 2014