I wanted to thank you for the help that you have me already brought in my precedent post, today I still need your advices to end the writing of my code:
I don t know if it s possible but I would like that we can see a track ( a line) between my circles when I move my mouse..
As if my circles could draw a line as one goes along in an reinterpretated style of Jackson Pollock and my circles would remain evanescent like it already are here..
I hope you understand me ^^'
I also noticed that my Void mousepressed did not work well because I wanted by clicking on A, it would appear a black circle which wouldn t remain on the background or it doesn't stay on the background.
Here is my code...
int click = 0;
int lenght = 200;
void setup() {
size(500, 500);
background(255);
smooth();
}
//declare arrays for mouse position in x and y, length
float x[] = new float[lenght];
float y[] = new float[lenght];
void draw() {
background(255);
//reads entire array
for (int i=1; i<100; i++) {
//the first value is deleted, all values are moved one position down
x[i-1] = x[i];
y[i-1] = y[i];
}
//mouse x and y are the new last item of the arrays
x[100-1] = mouseX;
y[100-1] = mouseY;
//read again the array, with new values
for (int i=0;i< x.length; i++) {
//dessin du cercle
noStroke();
fill(0, 0, 0, 100);
ellipse(x[i], y[i], i-30, i);
strokeWeight(4);
stroke(random(255, 255), 255);
}
}
void keyPressed() {
if(key=='a'){
fill(255);
x [click]=mouseX;
y [click]=mouseY;
click++;
}
}
Thank you for taking time to answer me and to explain my errors:)
I don t know if it s possible but I would like that we can see a track ( a line) between my circles when I move my mouse..
As if my circles could draw a line as one goes along in an reinterpretated style of Jackson Pollock and my circles would remain evanescent like it already are here..
I hope you understand me ^^'
I also noticed that my Void mousepressed did not work well because I wanted by clicking on A, it would appear a black circle which wouldn t remain on the background or it doesn't stay on the background.
Here is my code...
int click = 0;
int lenght = 200;
void setup() {
size(500, 500);
background(255);
smooth();
}
//declare arrays for mouse position in x and y, length
float x[] = new float[lenght];
float y[] = new float[lenght];
void draw() {
background(255);
//reads entire array
for (int i=1; i<100; i++) {
//the first value is deleted, all values are moved one position down
x[i-1] = x[i];
y[i-1] = y[i];
}
//mouse x and y are the new last item of the arrays
x[100-1] = mouseX;
y[100-1] = mouseY;
//read again the array, with new values
for (int i=0;i< x.length; i++) {
//dessin du cercle
noStroke();
fill(0, 0, 0, 100);
ellipse(x[i], y[i], i-30, i);
strokeWeight(4);
stroke(random(255, 255), 255);
}
}
void keyPressed() {
if(key=='a'){
fill(255);
x [click]=mouseX;
y [click]=mouseY;
click++;
}
}
Thank you for taking time to answer me and to explain my errors:)
1