custom scrollbar or slider

3

Attached Files

The following files have been attached to this tutorial:

.capx
.capx

scrollbar-multiple.capx

Download now 180.56 KB

Stats

6,133 visits, 9,545 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 28 Sep, 2014. Last updated 19 Feb, 2019

I needed a customisable scrollbar for my game that could be any size and position on the layout and display text and images. It's created using sprites.

Here are the basic elements.

I created it quickly so sprites are messy, obviously you'll use your own.

It relies on 3 main variables:

and the code:

Use the debugger to watch how the values change as you drag the slider.

UPDATE: on line 8 add int() around the slider percentage as sometimes the slider would move 1 pixel beyond the scrollbar bottom if the content was an odd size.

I'll also made a version which shows one method to do multiple pages using families.

Press 1 and 2 number keys to change content.

DEMO

Feedback welcome.

.CAPX
.CAPX

scrollbar-multiple.capx

Download now 180.56 KB
  • 2 Comments

  • Order by
Want to leave a comment? Login or Register an account!