hello,
you draw a rect with the command rect
e.g.
- rect (200,110,40,50);
before it you use the command fill to set the fill color.
Since you want to change the color when mouse over it:
You use an if statement to check wether the mouse pos is within
the rects position.
When this is the case, chose a color, otherwise another one.
The positions when drawing the rect and checking the mouse on it must be the same of course (e.g. 200 and 110 etc.):
- if (mouseX>200 && mouseX<200+40 &&
- mouseY>110 && mouseY<110+50) {
- fill (255,3,3); // red when mouse over
- }
- else
- {
- fill (3,3,255); // blue when mouse not over
- }
- // here comes rect
you can look up those commands in the reference.
show your code with this hints build into it and we will help further.
Greetings, Chrisir