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 & HelpSyntax Questions › reset initial state after drawing
Page Index Toggle Pages: 1
reset initial state after drawing (Read 844 times)
reset initial state after drawing
May 3rd, 2010, 11:32am
 
hi there,

i have a little problem and can't find the solution.

i have a button in my setup and on mouse over i draw some cubes around them, but once the mouse is not over the button i need to reset the scene.

how can i do that? is there a control msg that i'm missing?

thanks a lot
Re: reset initial state after drawing
Reply #1 - May 3rd, 2010, 2:48pm
 
You have to manage a state in draw(). For example a boolean bIsMouseOverButton.
Then you do something like:
Code:
if (bIsMouseOverButton)
{
drawCubes();
}
else
{
drawEmptyScene();
}

And of course, manage this state at the start of draw(), checking mouseX / mouseY against the bounds of your button.
Page Index Toggle Pages: 1