We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › controlP5 slider value step
Page Index Toggle Pages: 1
controlP5 slider value step (Read 1506 times)
controlP5 slider value step
May 7th, 2010, 11:40am
 
Hallo.
I want to change step of slider value to integral.
Not only use int(); but I need change also displayed value.

my code:
Code:

import controlP5.*;
ControlP5 controlP5;

void setup() {
controlP5 = new ControlP5(this);
controlP5.addSlider("int",0,7,3,10,height/2,60,20);
}

void draw(){}

void controlEvent(ControlEvent theEvent) {
if(theEvent.isController()) {
if(theEvent.controller().name()=="int")
{println(theEvent.controller().value());
}
}
}


someone help me please.
thank you.
Re: controlP5 slider value step
Reply #1 - May 8th, 2010, 6:59pm
 
I found it.
Code:
import controlP5.*;
ControlP5 controlP5;
int Int; // Need here in this case.
void setup() {
controlP5 = new ControlP5(this);
controlP5.addSlider("Int",0,7,3,10,height/2,60,20);
}

void draw(){}

void controlEvent(ControlEvent theEvent) {
if(theEvent.controller().name()=="Int")
{
println(theEvent.controller().value());
}
}
Thank you.
Page Index Toggle Pages: 1