Question: Processing - Java Swing I need to have my ellipse initially start in the middle of the canvas, and then start following the cursor once
Processing - Java Swing
I need to have my ellipse initially start in the middle of the canvas, and then start following the cursor once you put the cursor inside the canvas.
Here is my code
void setup() { size(600,600); }
void draw() { int ballX = mouseX; int ballY = mouseY;
int ballColour = 0;
int diameter = 25;
background(255); fill(ballColour); ellipse(ballX,ballY,diameter,diameter); }
Thank you!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
