Loading...
Logo
Processing Forum
I need a slider that increment its value by 2 because I need only the odd numbers within a range, any help will be much appreciated

Replies(3)

Lazy fix: 
Get the result from the slider (must be 1 of the whole data-types) and do this -> result = result/2*2 + 1;
Hi Ricardo, can you try this..

cp5.addSlider("sliderTicks2")
     .setPosition(100,370)
     .setWidth(400)
     .setRange(25,1) // values can range from big to small as well
     .setValue(13)
     .setNumberOfTickMarks(13)
     .setSliderMode(Slider.FLEXIBLE)
     ;

Thanks for both suggestions, all of them work but for my purposes I will have to go with GoToLoop anwser