josmiley / Luke spywoker (mutualaccount)
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.
Jan 28, 2015
Jan 24, 2015
Jan 20, 2015
Jan 15, 2015
Jan 14, 2015
Jan 7, 2015
Jan 4, 2015
Dec 30, 2014