Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started