示例#1
0
def array_alpha (surface):
    """pygame.surfarray.array_alpha (Surface): return array

    Copy pixel alphas into a 2d array.

    Copy the pixel alpha values (degree of transparency) from a Surface
    into a 2D array. This will work for any type of Surface
    format. Surfaces without a pixel alpha will return an array with all
    opaque values.

    This function will temporarily lock the Surface as pixels are copied
    (see the Surface.lock - lock the Surface memory for pixel access
    method).
    """
    global numpysf
    try:
        return numpysf.array_alpha(surface)
    except AttributeError:
        import pygame._numpysurfarray as numpysf
        return numpysf.array_alpha(surface)
示例#2
0
def array_alpha (surface):
    """pygame.surfarray.array_alpha (Surface): return array

    Copy pixel alphas into a 2d array.

    Copy the pixel alpha values (degree of transparency) from a Surface
    into a 2D array. This will work for any type of Surface
    format. Surfaces without a pixel alpha will return an array with all
    opaque values.

    This function will temporarily lock the Surface as pixels are copied
    (see the Surface.lock - lock the Surface memory for pixel access
    method).
    """
    return numpysf.array_alpha (surface)
示例#3
0
def array_alpha(surface):
    """pygame.surfarray.array_alpha (Surface): return array

    Copy pixel alphas into a 2d array.

    Copy the pixel alpha values (degree of transparency) from a Surface
    into a 2D array. This will work for any type of Surface
    format. Surfaces without a pixel alpha will return an array with all
    opaque values.

    This function will temporarily lock the Surface as pixels are copied
    (see the Surface.lock - lock the Surface memory for pixel access
    method).
    """
    if __arraytype == "numeric":
        return numericsf.array_alpha(surface)
    elif __arraytype == "numpy":
        return numpysf.array_alpha(surface)
    raise NotImplementedError("surface arrays are not supported")
示例#4
0
def array_alpha(surface):
    """pygame.surfarray.array_alpha (Surface): return array

    Copy pixel alphas into a 2d array.

    Copy the pixel alpha values (degree of transparency) from a Surface
    into a 2D array. This will work for any type of Surface
    format. Surfaces without a pixel alpha will return an array with all
    opaque values.

    This function will temporarily lock the Surface as pixels are copied
    (see the Surface.lock - lock the Surface memory for pixel access
    method).
    """
    if __arraytype == "numeric":
        return numericsf.array_alpha(surface)
    elif __arraytype == "numpy":
        return numpysf.array_alpha(surface)
    raise NotImplementedError("surface arrays are not supported")