Commits

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
  - pygame.music.unpause() 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/mouse.py

 
     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
     '''
     pygame.display._video_init_check()
 
+    if hasattr(x, '__len__'):  # Compat: allow tuple
+        x, y = x
     SDL_WarpMouse(x, y)
 
 def set_visible(visible):

File pygame/surfarray.py

     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))
     else:
         array[:,:] = 0xff