changing a shape
in
Programming Questions
•
9 months ago
i am wondering how a shape is changed on mouse movement? for starters i could not figure out how to assign a variable to the shape, and then using some sort of assignment operator, convert it. so i went another route, by clearing the canvas.
this seems to work (see below), but now my question is, after the mouse is moved, it will change to a square. how do i change it back to the circle on next mouse movement?
- void setup(){
- size(300,300);
- fill(30);
- background(255,204,0);
- ellipse(30,30,30,30);
- }
- void mouseMoved(){
- background(255,204,0);
- rect(30,30,30,30);
- }
1