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?
Develop games in your browser. Powerful, performant & highly capable.
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() there
Thanks, I think I figured it out.