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.
Mar 11, 2014
Mar 9, 2014
Mar 7, 2014
Mar 5, 2014
Mar 3, 2014
Mar 1, 2014
Feb 21, 2014
Feb 19, 2014
Feb 18, 2014