custom scrollbar or slider

3
  • 15 favourites

Attached Files

The following files have been attached to this tutorial:

.capx
.capx

scrollbar-multiple.capx

Download now 180.56 KB

Stats

5,040 visits, 7,905 views

Translations

This tutorial hasn't been translated.

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.

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!