aholkner  committed 62e6f4a

mouse and surfarray fixes reported by Lenard Lindstrom

  • Participants
  • Parent commits cb69c3c
  • Branches ctypes-soc

Comments (0)

Files changed (4)

  - pygame.display.set_palette fixed
  - pygame.font.Font.render blended zero-length string has alpha channel
  - fixed.
+ - pygame.mouse.set_pos accepts a tuple argument
+ - pygame.surfarray.array_colorkey mask was inverted; fixed
 Pygame-ctypes 0.09
 search libs e.g. SDL_ttf-2.0 before SDL_ttf
 24-bit don't assume RGB, could be BGR.
 default icon and font in py2exe
+lots of problems in Phil's Zanthor
+segfault in mixer, example in Phil's rustic

File pygame/

     return SDL_GetRelativeMouseState()
-def set_pos(x, y):
+def set_pos(x, y=0):
     '''Set the mouse cursor position.
     Set the current mouse position to arguments given. If the mouse cursor is
+    if hasattr(x, '__len__'):  # Compat: allow tuple
+        x, y = x
     SDL_WarpMouse(x, y)
 def set_visible(visible):

File pygame/

     if surface._surf.flags & SDL_SRCCOLORKEY:
         # XXX No work with numarray
         colorkey = surface._surf.format.colorkey
-        array = _array.choose(_array.equal(array, colorkey), (0, 0xff))
+        array = _array.choose(_array.equal(array, colorkey), (0xff, 0))
         array[:,:] = 0xff