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.
Mar 1, 2015
Feb 24, 2015
Feb 23, 2015
Feb 20, 2015
Feb 15, 2015
Feb 12, 2015