We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Mousepressed in Box Box as Button
Page Index Toggle Pages: 1
Mousepressed in Box? Box as Button? (Read 499 times)
Mousepressed in Box? Box as Button?
Dec 9th, 2009, 1:29pm
 

Hello,

I am programming a game and want to draw boxes, have them named or enumerated.

When the mouse is clicked on one box I want to evaluate this click
as a move. Therefore I then need the name or number or position of the box.

My questions are: How can I tell when a certain box is clicked with the mouse? How can I save the number of the box in a global variable and then evaluate this variable (e.g. via switch)?

Thank you!

Greetings!

Chris


Page Index Toggle Pages: 1