Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Position mouse in the middle of the screen with mouse look?

Author
Message
CocaCola
16
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 4th Oct 2011 03:43


It works when I remove the positioning of the mouse, but only until it hits a corner of the screen.

Always program as if the person maintaining your program is a psychopath that knows where you live
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 4th Oct 2011 04:05
You should only read mousex() and mousey() once per loop. Store the current value in a variable and use that variable throughout the loop. There's also alternatives such as mousemovex() and mousemovey() which give you the distance the mouse has travelled since the last call. Sometime you may need to flush the mousemove commands by calling them once before your main loop.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Login to post a reply

Server time is: 2026-07-11 14:36:22
Your offset time is: 2026-07-11 14:36:22