iDevGames Forums
hiding the cursor - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Tools & Technology (/forum-10.html)
+--- Thread: hiding the cursor (/thread-275.html)



hiding the cursor - NelsonMandella - Mar 5, 2010 08:15 PM

So I have a window with a custom view, while the mouse is within this window I want to hide it and draw my own cursor image, then show it once the mouse leaves the game window.

So I added this to my main loop.

Code:
if ( is_point_in_game_window( mymouse))
     [NSCursor hide];
else
     [NSCursor unhide];

The problem is that once I move the mouse out of the window, there's a huge delay before it's unhidden. I believe, but am not sure, that this is because "mymouse" is updated through the view's mouseMoved event. If this is the case, then is there a way to read the position of the mouse every frame instead of waiting for a mouseMoved event to fire? And if not then what might be the cause?


hiding the cursor - OneSadCookie - Mar 5, 2010 10:12 PM

the solution I've used to this is to define a mouse tracking region that fills the view, and listen to the mouseEntered/mouseExited events.


RE: hiding the cursor - Devge - Sep 30, 2010 11:02 PM

Hmm good...i was thnking about this kind of code that how we can hide the cursor in the game while playing but i didn't understand one thing that is this code in Java?....colon cleanse reviews


RE: hiding the cursor - Skorche - Oct 1, 2010 06:13 AM

It's Objective-C.