Interaction & Control: Learning Mouse Tools

0 Comments
Today we learned how to use aspect of mouse control. We did different things to see how mouse control features work and created some code to make applications that you can control. In some ways, this was also a lesson on control and how the control of objects through the use of mouse, can be coded.

The first attempt at mouse control was through the use of the mousePressed method. With this piece of code an if statement was created and actions commenced if the Boolean expression of the mousePressed method was equal to true. Therefore is mousePressed was not equal to true (false), then no actions occured. The statements written if mousePressed equals true resulted in the movement of the rectangle by a specfied number.


The next processing application written was one based on the movement of the mouse. According to tutor's we used the most classic example that shows interaction, and I found it pretty interactive myself. We created a line that was meant to act as if it was dragging an ellipse, with the length of the line differing and affecting the speed and distance the ellipse must travel. The x and y positions are base on the x and y positions of the mouse. When the mouse moves in the x and y positions, the objects will move accordingly.




You may also like

No comments:

Powered by Blogger.