I am trying to learn how to create offsets with mouse movement and I am coming up with an error message ("Duplicate method setup() in type") with the following script that I can't figure out:
Can someone give me an example of the use of print() and printIn(), in the context of a specific function so I can see how it works? I'm a new programmer.
Hi,
As a total beginner with Processing, I created an exercise for myself. The idea is that a line will be drawn from (100, 50) to (mouseX, mouseY), starting with a blue background, and everytime the mouse is clicked the background changes color. So I got it to change from blue to green, but I can't figure out how to change to a third background color on the next mouse click. Can anyone help me with this?
Also, I don't understand why the drawing starts with a line from the upper left corner to the point of the first line at 100, 50. Can someone explain where the code is for this?
I am a Processing beginner, and I am wondering if someone wouldn't mind explaining what is actually happening in the following lines of code that I'm having trouble interpreting:
for (int y = 0; y < height+45; y += 40) {
fill(255, 140);
ellipse(0, y, 40, 40);
}
The following is work I did for a tutorial which gives me an error code saying
can't find anything named "i". Can anyone help me figure out what I did wrong?
size(480, 120);
smooth();
strokeWeight(8);
for (int i = 20; i < 400; i += 60); {
line(i, 40, i + 60, 80);
}