Hi, I’ve followed a few tutorials and know how to use the GUI to make buttons, type inputs and color pickers but now that I put all these in classes I found it easier to use the ofParameter class and just add param groups for each class to a main GUI.
The problem with this is that using ofParameter I only understand how to create simple sliders and such like float,int,boolean and vec3. How can I add buttons/type inputs/ and color pickers to param groups ?
Thanks I can’t believe it’s this simple !
there’s two small things I’d like to ask concerning this, it seems like the types are attached to the inputs.
if i wanted to type an int or a float inside of an int or float slider, how would I proceed ?
also the bool only creates a checkbox, not a button, should I make it work like a button via script or am i missing something ?
right click on the float slider, and enter the value you want to use. You can use an int in place of a float, but not the reverse of course…
I think you might mean toggle? button turns on or off when pressing on it, toggle sends a On message then turns itself Off on the next frame. For that, I personnaly check its value in the ofApp::update :
if(myButton){
cout << "ok we got an ON message" << endl;
// do something with it
myButton = false;
}
IT is actually much simpler than that.
use ofParameter<void> which will give you a button, not a toggle. If you add a listener to it then it will get called each time the button is pressed.