Mouse Actions and Mouse Functions…HOW? 
Posted: 27 February 2016 11:19 PM   [ Ignore ]
Joined  2016-02-27
Total Posts:  1
New Member

Create a program that will create a square and fill it with a certain color based on the x and y location of the mouse. Use the mouseMoved () function and create appropriate if statements using the appropriate condition and boolean logic operator to create the square and fill it with a color. The sketch should contain a setup (), draw () as well as the mouseMoved() function. The background will be set to black and will change to the appropriate color when the mouse enters the area specified by the condition. All other areas will remain black.

mouse function

The frame should be size 400 by 400.

Upper left section:  yellow

Upper right section: red

Bottom left section:  blue

Bottom right section: green

Create a program that will change the background color based on the mouse.
You will create a setup(), draw() function.  The size of the frame will by 400 by 400. 

Create a mousePressed() function.  Check to see if the RIGHT or LEFT mouse button has been pressed.  Change the background color to red if the LEFT mouse is pressed and blue if the right mouse is pressed. 
Create a mouseReleased() function.  Change the background to yellow.
Create a mouseMoved() function.  Change the background to green. 
Create a mouseDragged() function.  Change the background to white.

I have some clue, but I am still not getting the result needed. I am not experienced in programming, so I am clueless. This is on processing3.01. I just need the mouseMoved() part..and then I can pretty much do the others.

Posted: 07 March 2016 03:17 PM   [ Ignore ]   [ # 1 ]
Joined  2014-02-09
Total Posts:  16
New Member

what do you mean? where is the problem?