[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] surfarray ..



Hi,

I've got a problem with surfarray,the sample code looks something like this:

font = pygame.font ; font.init()
f = font.Font("uifont.ttf",32)
surf = f.render("test",0,(250,250,250))
asurf = pygame.surfarray.array3d(surf)
# the part that doesn't work:
surf = pygame.surfarray.make_surface(asurf)

and the error looks something like this:

Traceback (most recent call last):
  File "./test.py", line 24, in ?
    surf = pygame.surfarray.make_surface(asurf)
ValueError: Invalid array datatype for surface

What am I doing wrong ?


sammy

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org