custom scrollbar or slider

  • 15 favourites

Attached Files

The following files have been attached to this tutorial:

.capx

scrollbar.capx

Download now 178 KB
.capx

scrollbar-multiple.capx

Download now 180 KB

Stats

2,937 visits, 4,546 views

Translations

This tutorial hasn't been translated.

Tools

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

scrollbar.capx

Download now 178 KB
.CAPX

scrollbar-multiple.capx

Download now 180 KB
  • 1 Comments

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