Interaction
Let’s make something interactive. Processing has some nice functions for working with the users mouse. You can get the coordinates with mouseX
and mouseY
variables, which are updated each frame.
The example below draws a point to the current mouse coordinate. You can edit the code to draw for example a rectangle, circle or a line to the current mouse position.