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.
Aug 30, 2016
Aug 24, 2016
Aug 3, 2016
Aug 2, 2016
Aug 1, 2016
Jul 29, 2016
Jul 24, 2016