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.