Hello, I'm new to the Processing and would love to know how to change width of the ellipse after it has been already drawn with a mouse, using slider from cp5. This is my current code which changes width of a ellipse before its been drawn with a mouse.
import controlP5.*;
ControlP5 cp5;
int slider = 100;
void setup(){
size(800,800);
cp5 = new ControlP5(this);
cp5.addSlider("slider").setPosition(400,400).setRange(0,255);
}
void draw(){
int w=slider;
if(mousePressed) ellipse(mouseX, mouseY, w, 5);
}
Any help is appreciated. Thank you!