ControlP5 auto-arrange problem: large space between toggles when using .linebreak()
in
Contributed Library Questions
•
1 year ago
Hello all,
How do I set the space between elements when using .linebreak(), I'd like these toggles to be closer together vertically
- void menu() {
- controlP5.setAutoDraw(false);
- controlP5.begin(20, 40);
- controlP5.addToggle("togExtude").linebreak();
- controlP5.addToggle("togJoints").linebreak();
- controlP5.addToggle("togFace").linebreak();
- controlP5.addToggle("togPoints").linebreak();
- controlP5.end();
- setToggle("togExtude", "Extrude", 1);
- setToggle("togJoints", "Joints", 1);
- setToggle("togFace", "faces", 1);
- setToggle("togPoints", "points", 1);
- }
- void togExtude(boolean theFlag) {
- showExtrude = theFlag==false ? false: true;
- }
- void togJoints(boolean theFlag) {
- showJoint = theFlag==false ? false: true;
- }
- void togPoints(boolean theFlag) {
- showPoints = theFlag==false ? false: true;
- }
- void togFace(boolean theFlag) {
- showFace = theFlag==false ? false: true;
- }
- void setToggle(String s, String l, int state) {
- controlP5.controller(s).setLabel(l);
- controlP5.controller(s).setValue(state);
- controlP5.controller(s).setSize(10, 10);
- controlP5.controller(s).setColorActive(color(255, 166, 0));
- controlP5.controller(s).setColorBackground(color(0, 146, 255));
- controlP5.controller(s).setColorCaptionLabel(color(0, 146, 255));
- controlP5.controller(s).captionLabel().style().marginTop=-13;
- controlP5.controller(s).captionLabel().style().marginLeft=13;
- }
Thanks in advance!
1