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.

AppGameKit Classic Chat / Adding Smoothness to a mouse move, can you help ?

Author
Message
haliop_New
User Banned
Posted: 21st Nov 2016 09:25
I'm trying to smooth my pointer or GetDirectionX()/Y()

I have managed to do this in the past but for some reason I can't seam to figure it out now...

can you help ?

a simple mouse\pointer smooth.

thank you for your time,
haliop,
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 21st Nov 2016 16:53
Save the position you want your mouse to move to in x and y variables.
Then each cycle, move your mouse pointer n% of the distance from where you are now to the new position.
The lower n is, the more smooth the motion will be.

It works continuously, just keep overwriting the new position, and always take the % from the current position.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
haliop_New
User Banned
Posted: 22nd Nov 2016 08:11
Thank you.
ill try.

Login to post a reply

Server time is: 2024-11-24 22:44:50
Your offset time is: 2024-11-24 22:44:50