# How would I go on and create a slider? Without using any libraries?

**URL:** <https://discourse.processing.org/t/how-would-i-go-on-and-create-a-slider-without-using-any-libraries/16491>\
**Category:** Coding Questions\
**Created:** [December 18, 2019, 1:15pm UTC](https://discourse.processing.org/t/how-would-i-go-on-and-create-a-slider-without-using-any-libraries/16491 "2019-12-18T13:15:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![needhelpwithsliders](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@needhelpwithsliders](https://discourse.processing.org/u/needhelpwithsliders)\
**Post date:** [December 18, 2019, 1:15pm UTC](https://discourse.processing.org/t/how-would-i-go-on-and-create-a-slider-without-using-any-libraries/16491/1 "2019-12-18T13:15:54Z")

</div>

I’m making a game, which also includes a settings tab where the end-user can adjust settings to their preference, the problem is however that I have no idea how to make a slider without making use of a library, the slider I’ve made uses a lot of double code, which I’d like to avoid. I was thinking of making a for-loop but I have no idea where to start, I would love it if someone could help me out!  
Sample code: [https://i.imgur.com/DoAITVt.png](https://i.imgur.com/DoAITVt.png)

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [December 18, 2019, 1:38pm UTC](https://discourse.processing.org/t/how-would-i-go-on-and-create-a-slider-without-using-any-libraries/16491/2 "2019-12-18T13:38:31Z")

</div>

-a- if you have made already a functioning slider  
cut it out to a little ( running ) test project  
and post it here, possibly can work on it…

( please use the `</> code tag ` from editor menu to paste here )

-b- also for adjustments like that i did 2 very different approaches  
[Use Key and [+] [-] as color sliders?](https://discourse.processing.org/t/use-key-and-as-color-sliders/16397) ,  
key plus plus and mousewheel plus plus  
what are mostly 2 lines per ( invisible ) slider  
and could also be used while the game / not only from a setup page.

( i come up with that ideas while adjusting colors … for painter type sketches )

-c- but what’s your problem with professional slider like from G4P  
( besides i love you want to learn it )

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [December 18, 2019, 2:00pm UTC](https://discourse.processing.org/t/how-would-i-go-on-and-create-a-slider-without-using-any-libraries/16491/3 "2019-12-18T14:00:42Z")

</div>

see also here, in the examples section

[https://www.processing.org/examples/scrollbar.html](https://www.processing.org/examples/scrollbar.html)
