Learn creative coding writing simple programs

96. Easier mouse in a rectangle

Using rectMode(CENTER) makes it harder to find out if the mouse is inside a square. If we use rectMode(CORNERS) the program becomes much simpler because we don't need to calculate the position of the four walls of our rectangle: we already know them.
In this episode we also see a small example of how we can generate colors that have the same hue but a different brightness or saturation.

Tags: rect, inside, mouse, point

Code editor

You can make changes to the code below. Then
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus