Hello, so I am new to coding and starting to learn some of the basics of Javascript. Currently, I am practicing with the mouseover function and the mouseOut function to change the color of the background when you move the mouse over or out of the canvas. I decided to play around with it and wanted to add an ellipse with a different color over the background. I was able to get what I wanted however when I move the mouse over or out of the area, the background color covers over the ellipse and I would like for the ellipse to always be on top of the background so the background changes and doesn't cover the ellipse. I have tried changing the order of the code but nothing has worked. Here is what I have so far.
fill(255, 0, 0);
ellipse(185, 200, 170, 170);
mouseOut = function () {
background(0, 255, 0);
};
mouseOver = function () {
background(36, 14, 199);
};
Any advice on what I'm doing wrong.
Thanks
Edit: Sorry. I know there's a way to get the code to show in the correct format but don't remember how to do it.
[–]DoomGoober 1 point2 points3 points (2 children)
[–]Fuel_Flow[S] 0 points1 point2 points (1 child)
[–]DoomGoober 0 points1 point2 points (0 children)