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.

Newcomers AppGameKit Corner / [SOLVED] Smooth Scrolling with SetViewOffset

Author
Message
c0d3r9
1
Years of Service
User Offline
Joined: 2nd Oct 2017
Location:
Posted: 13th Feb 2018 00:09 Edited at: 13th Feb 2018 01:56
Atm i try to scroll over my tilemap with this:


But its not smooth scrolling.
I try several mv_x and mv_y variables but it doesn´t look fine.
It jerks terribly. (i haven´t to much tiles)

Any idea to solve the problem?

The author of this post has marked a post as an answer.

Go to answer

blink0k
AGK Developer
5
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Feb 2018 02:23
Maybe try easing. The closer the easing value is to 1 = faster scroll, closer to zero = slower scroll

c0d3r9
1
Years of Service
User Offline
Joined: 2nd Oct 2017
Location:
Posted: 13th Feb 2018 08:58 Edited at: 13th Feb 2018 13:13
Thank you, and yes its smoother then before.

edit: now if o scroll for some seconds in a direction it stutters. Try next a big image a map and the same problem.
Next i write the code with Tier 2 and here is the same problem.
Optional i should try another way, but i think SetViewOffset should run smoothly without scroll-stuttering.

Have anybody try SetViewOffset in this way?
Rich Dersheimer
AGK Developer
Silver Codemaster
9
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 13th Feb 2018 14:41
This post has been marked by the post author as the answer.
Are those integer variables? If they are, try using floats, might be smoother.
c0d3r9
1
Years of Service
User Offline
Joined: 2nd Oct 2017
Location:
Posted: 13th Feb 2018 21:58
Yes a little bit smoother....have to test some values
PHeMoX
User Offline
Joined: 9th Jan 2018
Location:
Posted: 14th Apr 2018 11:40
Yeah Rich is correct, make sure anything and everything involved with the scrolling uses floats, that way things should be much smoother. Sometimes conditional loops can also create a minute stutter, so make sure those are nothing out of the ordinary too (don't have an example at hand at the moment).
TheAppGuruz
4
Years of Service
User Offline
Joined: 9th Aug 2014
Location:
Posted: 1st May 2018 07:13
Thank you, and Yes a little bit smoother than before.
Richard_6
1
Years of Service
User Offline
Joined: 3rd Feb 2017
Location:
Posted: 2nd May 2018 12:10
I just comment how impressive the scrolling is looking in a video shown on this thead.

Login to post a reply

Server time is: 2018-10-15 12:21:02
Your offset time is: 2018-10-15 12:21:02