How do I make scroll bar?

0 favourites
  • 2 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • How do i make a scrolling bar like this?


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Create 2 objects: the actual bar and the area the bar sits in. These should be created in a layer with parallax set to 0 (so these objects won't scroll). The bar needs some instance variables as well (IsClicked)

    Then add the following events:

    If bar clicked ----- set bar.IsClicked to true

    if mouse click released && if bar.IsClicked = true ------ bar.IsClicked = false

    If bar.IsClicked = true ------ set bar position (self.x, mouse.y)

    EveryTick --------- Scroll to position (scroll.x ,( bar.positionY * some scale factor))

    Because you have the scroll bar in its own layer that does not scroll, it should remain in place regardless of scroll. Some scale factor, if set to 1, will scroll as far as you move the bar. I would set this to 2 or 3 depending on how far you need to scroll.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)