How to handle a button for iPhone.

Previous topic - Next topic

ggindlesperger

I am stuck on something that is probably easy,but I can not figure it out. I want to make a simple button. The button should call a routine when touched. My problem is that once it is touched it continues to keep calling the routine until you touch somewhere else outsidre the button. I've tried setmouse to set the mouse outside the area once the routine is called, but that does not seem to do it on the iPhone. Setmouse works as I expected when I compile and run in GLBasic, but when I compile for iPhone and and test it just continues going to the routine until you touch somewhere else on the screen.

Any thought or idea on what I am missing?

Thanks so much for any help.

I am using the Premium SDK if that matters.

trucidare

Code (glbasic) Select

WHILE TRUE
   MOUSESTATE mx,my,b1,b2
   IF b1 = 0 THEN pressed = 0

   IF b1 AND pressed = 0
      Call_yout_function()
      pressed = 1
   ENDIF
   SHOWSCREEN
WEND

MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

ggindlesperger

Thanks very much. I will try that out when I get home.