I'm not sure if this is the right section. The question deals more with basic programming but it does include the controlP5 library so I put it in here. Anyways....
I'm trying to draw circles with mousePressed, so in order to get them to show up I have to put my background() in the setup portion so it doesn't redraw over the circles. The only problem is I need to draw text and a rectangle that is changed by controlP5 sliders. Also my text looks bad when you put the background in setup, not sure why...
Is there anyway to redraw the background when I change the sliders but not when click the mouse to draw ellipses?
I've tried to add background(255); to the control event section for when I move the sliders but that blocks the rectangle from being updated till I release the mouse.
I feel like I'm missing something really obvious but I can't seem to find how to do it. Thanks in advance for the help!
Here's my code:
import controlP5.*;
ControlP5 cp5;
int unitWidth;
int floorToFloor;
float actualWidth;
float actualHeight;
float rectX1;
float rectX2;
float rectY1;
float rectY2;
void setup() {
size(1024,768);
background(255); //With background here my circles work but when I change the sliders to change the rectangle
//it doesn't redraw over the old ones.
cp5 = new ControlP5(this);
cp5.setColorLabel(color(0));
cp5.setColorValue(color(255));
// sliders that animate the rectangle, I want these to show the current rectangle without showing the "after images"
I'm new to processing and trying to create a GUI interface using controlP5. So far it's been really useful but I'm stuck with this problem.
I'm trying to create a "main menu" of sorts with buttons linking to other frames. I was able to make a separate frame with this example (
http://www.sojamo.de/libraries/controlP5/examples/extra/ControlP5frame/ControlP5frame.pde) but I want to be able to change visibility of it. I see the line f.setVisible(true); but I'm not sure how to change that with a button that's on the original frame. Mostly, I'm not really sure how the controlEvents work between the main window and the PApplet control frame.
I feel like the answer is really obvious but I can't seem to find it...
I'm new to processing and programming in general. I'm trying to develop an interface to display design iterations using exported screenshots and parameter values (.csv file) from Grasshopper/Rhino 3D. I've managed put together code I've found online and in tutorial examples to get pretty far. I've been able to load in all 1000 screenshots, create sliders from controlp5, and load in the .csv file fairly well. My problem is linking them together.
I have 3 sliders for X,Y,Z values in processing (integers, 1 to 10). The data exported from Grasshopper has the screenshot file name in the first column then the corresponding X,Y,Z values that apply to the screen shot. Like this: "animation0002.png, 1, 1, 3". Each line has a separate screenshot filename with its data.
What I want to do is have processing display the correct screenshot that matches the slider's inputs. I'm not sure how to go about searching or matching the string array with the sliders. I'll post my code below. Let me know if anything is unclear. Thanks!
import controlP5.*;
ControlP5 cp5;
Slider abc;
int numFrames = 1000; // The number of screenshots to cycle through