Vertical slider

Get help using Construct 2

Post » Wed Apr 04, 2012 1:47 am

Having a brain fart on how to set up a vertical slider control for scrolling y over two layers, where slider.y max=windowheight, or layer 1 height, and scrolly max= layoutheight, or layer 0 height.
Im trying set scrolly to lerp(0,layoutheight,... and the rest escapes me atm.

Any thoughts?
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Wed Apr 04, 2012 2:21 am

A = difference between slider starting y and ending y
B = slider initial position
C = slider maximum value you want

lerp(0, layoutheight, ((slider.y - B) / A) * C)

I think this is it

EDIT: actually, I think you don't even need the lerp() there7Soul2012-04-04 02:23:24
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Wed Apr 04, 2012 4:47 am

Thanks, I think I figured it out.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests