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 / Smooth Scrolling with SetViewOffset

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

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?
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

+ Code Snippet
c0d3r9
User Offline
Joined: 2nd Oct 2017
Location: Germany
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
8
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 13th Feb 2018 14:41
Are those integer variables? If they are, try using floats, might be smoother.
c0d3r9
User Offline
Joined: 2nd Oct 2017
Location: Germany
Posted: 13th Feb 2018 21:58
Yes a little bit smoother....have to test some values

Login to post a reply

Server time is: 2018-02-23 06:27:44
Your offset time is: 2018-02-23 06:27:44