Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 6910 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Yeah, I''m asking about smooth scrolling.. I have a timer which traces mouse x,y coords, if they''re 599 or 799 then scroll.. MY Q is: If i would put a mouse on edge coords - (0,0), (0,599),(599,0) and (599,799) how can i make smooth scroling?? Also, If i got a timer which pluses chage integer(48 or 24, any /number/ , how would i make a smooth scrolling with it? Using big period of time ,or big change?? TA!! )

Share this post

Link to post
Share on other sites
For scrolling in my tile engine, I kept track of the scrolling location in a couple of variables, scrollx and scrolly. Then when the mouse was at a screen edge it would just increase/decrease the right one. It only checked the mouse position every frame (game is set to run at about 20fps) so the scrolling speed is constant. If you wanted to have varying speeds you could have a time variable like last_scroll and the time is stored in that whenever you scroll. Then when it wants to scroll again it checks to see if a specific time has passed.

Hope that helps.

- Daniel
my homepage

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!