Slowly scroll to other parts of the screen

Get help using Construct 2

Post » Thu Dec 13, 2012 9:24 pm

My Window size is 1/4 the size of my layout. Therefore, I feel like I can get 4 static screens out of this layout.

So I would like to push a button from within the starting view and have the screen slowly scroll to the right.

I know I can use the System Set scroll X ... and this works as far as location but its instantaneous.

I would like a little character in the transition... Anyone?

**I tried messing with time scale right before the scroll and that didnt do anything for me. I would really like some options like jquery UI has for animate... http://jqueryui.com/effect/#default

Any plugins that do this sort of thing maybe?

Thanks!
B
12
S
4
G
3
Posts: 8
Reputation: 3,048

Post » Thu Dec 13, 2012 11:18 pm

https://dl.dropbox.com/u/666574/smooth%20scroll%20using%20lerp.capx

Press right arrow to scroll each time.

Hope that helps. Let me know if you need anything explaining.
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Fri Dec 14, 2012 12:09 am

You want to use Lerp to scroll to it. It gives you that quick but more natural movement.
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Fri Dec 14, 2012 4:48 pm

This looks just like what I will need! Thank you!!! Pretty straight-forward too... my ONLY question from glancing at it is this:

xScroll + 0.5 * dt   <----- What is 'dt' ?
B
12
S
4
G
3
Posts: 8
Reputation: 3,048

Post » Fri Dec 14, 2012 5:46 pm

No problem. Glad it's what you were after.

dt = deltatime, a great explanation here.
http://www.scirra.com/tutorials/67/delta-time-and-framerate-independence/page-1

(or "timedelta" if you're familiar with Construct Classic)

So in my example, since lerp is 0.0 - 1.0 (0% - 100%)
1.0 = moves 640pixels in 1 second
0.5 = moves 320pixels in 1 second
and so on.
I think I explained that right.. bit of a hangover still *groan* :)procrastinator2012-12-14 17:49:13
B
15
S
5
G
7
Posts: 877
Reputation: 5,650


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 28 guests