Travis Oliphant wrote:
Lenard Lindstrom wrote:
Travis Oliphant wrote:
Did you confirm that pygame.surfarray.pixels_alpha() returns a
writable array?
I didn't check. Could you show me code that demonstrates the problem.
This example program:
import pygame
from pygame.locals import *
pygame.init()
a = pygame.Surface((1, 1), SWSURFACE, 24)
a.set_colorkey((255, 255, 255))
x = pygame.surfarray.array_colorkey(a)
b = pygame.Surface(a.get_rect().size, SRCALPHA, 32)
pygame.surfarray.pixels_alpha(b)[...] = x
raises the following exception:
Traceback (most recent call last):
File "colorkey.py", line 11, in <module>
pygame.surfarray.pixels_alpha(b)[...] = x
RuntimeError: array is not writeable
I am using pygame 1.8.0.rc1 compiled with mingw gcc 3.4.5 on win32 and
linked to msvcr71.dll, Python 2.5, numpy 1.0.1.