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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!