Scroll bar?

I’m wondering how would you go about creating a scroll bar in BGE? So that the mouse can drag it in either direction affecting another object that moves in the opposite direction?


yeah, just couple moving the object over with the value in my widgets example

ita failry new and in resources,

you can build your own
A) dragging
A1) click on slider = begin drag (remember hit position relative to the slider path)
A2) while slider remains clicked =

  • move the slider the distance between the current hit point and the stored position from A1) [within the limits]
  • calculate the relative position in between the limits (0.0 <= x <= 1.0) which is you result
    A3) release drag = done
    A4) cancel drag = place the slider at the stored position

B) paging
B1) click on the area above or below the slider = position the slider the according amount of distance above or below the current position [within the limits]

here is a slider :smiley:


SimpleSlider.blend (486 KB)

Thanks for all the responses guys, turns out it was fairly simple to do (just matching the hitposition.y to the scroll.hitposition.y).

Here is a .blend for anyone still curious how to do this.

scroll bar.blend (536 KB)