def array_colorkey (surface): """pygame.surfarray.array_colorkey (Surface): return array Copy the colorkey values into a 2d array. Create a new array with the colorkey transparency value from each pixel. If the pixel matches the colorkey it will be fully tranparent; otherwise it will be fully opaque. This will work on any type of Surface format. If the image has no colorkey a solid opaque array will be returned. This function will temporarily lock the Surface as pixels are copied. """ global numpysf try: return numpysf.array_colorkey(surface) except AttributeError: import pygame._numpysurfarray as numpysf return numpysf.array_colorkey(surface)
def array_colorkey (surface): """pygame.surfarray.array_colorkey (Surface): return array Copy the colorkey values into a 2d array. Create a new array with the colorkey transparency value from each pixel. If the pixel matches the colorkey it will be fully tranparent; otherwise it will be fully opaque. This will work on any type of Surface format. If the image has no colorkey a solid opaque array will be returned. This function will temporarily lock the Surface as pixels are copied. """ return numpysf.array_colorkey (surface)
def array_colorkey(surface): """pygame.surfarray.array_colorkey (Surface): return array Copy the colorkey values into a 2d array. Create a new array with the colorkey transparency value from each pixel. If the pixel matches the colorkey it will be fully tranparent; otherwise it will be fully opaque. This will work on any type of Surface format. If the image has no colorkey a solid opaque array will be returned. This function will temporarily lock the Surface as pixels are copied. """ if __arraytype == "numeric": return numericsf.array_colorkey(surface) elif __arraytype == "numpy": return numpysf.array_colorkey(surface) raise NotImplementedError("surface arrays are not supported")