[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] per pixel alpha revisited



I just setup a new 64-bit Ubuntu 9.10 machine and ran into a nasty
problem with per pixel alpha. The minimal code fragment below works
correctly under 32-bit 9.04 (and lower) machines, but fails completely
under 9.10:

   import pygame
   pygame.init()
   screen = pygame.display.set_mode((1024, 768), 0)
   alpha = pygame.surfarray.pixels_alpha(\
              pygame.Surface((1, 1), flags=0, depth=32).convert_alpha())
   alpha[:] = 128
   print alpha

Ubuntu 9.04 (pygame 1.8.1release + python 2.6.2)
  [ [255] ]

Ubuntu 9.10 (pygame 1.8.1release + python 2.6.4)
  [ [128] ]

Is this a bug? Or is the code I've been using for years to get per
pixel alpha values just plain wrong?? What's the OFFICIAL way to
instantiate a sprite with per pixel alpha?

Thanks,
/jamie

--
James Mazer
Department of Neurobiology
Yale School of Medicine
phone: 203-737-5853
fax: 203-785-5263