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

[pygame] Mouse in/out of Pygame window?



When running pygame not in FULLSCREEN mode, is there an easy way to
determine whether the mouse is in or out of the window?

I hope there is, because the solution I'm thinking of involves using
mouse.get_rel() when the cursor is near a window's edge. That doesn't
sound very efficient.

---

The reason I'm doing this is because I've created a little app that shows
a small window with part of an image. As you move to the edge of the
window, your focuse on the image moves, a la Starcraft. But if you move
the mouse out of the window completely, I'd like the scrolling to stop.

So there is a related question: In pygame, is it feasible to create a
larger-than-screen-sized surface and move around on the screen? Or is will
this be too slow, even with > 1 pixel jumps? I'm considering 800 x 600,
but I could live with 640 x 480.

Thanks!

---
Zak Arntson
www.harlekin-maus.com - Games - Lots of 'em