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 › buttom increment
Page Index Toggle Pages: 1
buttom increment (Read 935 times)
buttom increment
Nov 16th, 2009, 9:54am
 
Hi!I must do a buttom and everytime I click it, a graphic primitive must increment about one! I use the ImageButtom default library to buttom!

How can I do this?
Help me!
Thanks for all!
Re: buttom increment
Reply #1 - Nov 16th, 2009, 9:57am
 
Good! Go for it!
Re: buttom increment
Reply #2 - Nov 16th, 2009, 10:31am
 
How can I do this?
Re: buttom increment
Reply #3 - Nov 16th, 2009, 10:33am
 
PhiLho  wrote on Nov 16th, 2009, 9:57am:
Good! Go for it!


Grin

asylum - you're not exactly clear on what, if anything, you want help with.  If you don't know where to start say so.  If you've tried something and it doesn't work, post some code for us to look at...
Re: buttom increment
Reply #4 - Nov 16th, 2009, 11:14am
 
Sorry but I'm Italian Tongue

When I click one buttom, I would to one rect increment its high of 10 pixel.
Re: buttom increment
Reply #5 - Nov 16th, 2009, 2:19pm
 
Sorry, I can only manage English or French.  Anyone know any Italian?  I think it might be the only way we get an intelligible question...
Re: buttom increment
Reply #6 - Nov 16th, 2009, 4:04pm
 
Well, the second explanation was at least a more precise specification.
So you will have a sketch with a button taken somewhere, able to do something when clicking on it; and a rectangle.
You should parametrize the rectangle's height with a global variable, ie. defined outside of setup() and draw().
In draw(), you call background() to erase the previous rectangle, and draw the shape, using this global height.
When user clicks on the button, you increase the height, which will be use automatically in draw().
I hope I am clear enough; I don't want to give whole code, as it looks like homework. Smiley
Page Index Toggle Pages: 1