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 ImageImage
B
172
S
50
G
183
Posts: 8,443
Reputation: 115,605

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
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Wed Apr 04, 2012 4:47 am

Thanks, I think I figured it out.
Image ImageImage
B
172
S
50
G
183
Posts: 8,443
Reputation: 115,605


Return to How do I....?

Who is online

Users browsing this forum: mariogamer, matriax and 9 guests