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

[pygame] Still a bug in array_colorkey?



Hi,

I was under the impression that the "lock" bug was fixed in
pygame.surfarray.array_colorkey. But when trying to use it I still needs to
unlock the Surface twice to get it to work.

I'm using pygame 1.7.1.

Best Regards
/John
import pygame
from pygame.locals import *

pygame.init()    
screen = pygame.display.set_mode((300, 300),1)
img = pygame.Surface([20,20])
img.fill((0,0,255))
img.set_colorkey((0xff, 0xff, 0xff), RLEACCEL)
hitmask = pygame.surfarray.array_colorkey(img)

# Unlock the surface twice and it will work again.
#img.unlock()
#img.unlock()
    
running = 1
while running:
   for event in pygame.event.get():
      if event.type == QUIT:
         running = 0
      screen.fill((255,255,255))                   
      screen.blit(img,(10,10))
      pygame.display.flip()