One touch 2 buttons?

Discussion in 'Public Game Developers Forum' started by NickFalk, Jun 17, 2009.

  1. NickFalk

    NickFalk Well-Known Member

    OK guys and gals(?) I'm trying to achieve something that I'm not sure is entirely possible.

    I have Button1 and Button2. I want to perform certain tasks if the user "Touch Drag Exits" from Button1 and into Button2. It seems my problem is twofold:
    1. The touch is bound to Button1 for its duration.
    2. It seems there is no standard method for sliding a touch into a button. (Although the latter seems to be exactly how the keyboard works).


    Anyone care to share their thoughts on the matter?
     
  2. kohjingyu

    kohjingyu Well-Known Member

    Mar 20, 2009
    1,770
    0
    0
    Student/Developer
    Singapore
    What about tracking the user's touch location instead of using buttons and when the touch is around a certain x and y then do whatever thing you need?
     
  3. NickFalk

    NickFalk Well-Known Member

    A great solution, The problem is that I'm too lazy and hoped I could solve the whole thing through IB and convenience methods. ;)
     
  4. M of IMAK

    M of IMAK Well-Known Member

    May 26, 2009
    199
    0
    0
    iPhone App Developer
    Austin, TX
    I think the non-lazy thing to do here IS to track the touches as froggy1233 suggested. Trying to get IB to do what you want will probably take much, much longer. I don't think it supports what you are trying to do. I believe the touch entering a button only works for touches that previously exited that same button.

    You can add the touchesBegin and touchesEnd routines right to your custom UIView code. It's a good thing to learn, also, if you haven't done this before.
     
  5. NickFalk

    NickFalk Well-Known Member

    You're quite right about the touch entered. It should have been named re-enter. I do miss a proper enter convenience method though as it really the one piece missing to get my app working as intended.

    All in all you're advise is sound and I guess I just have to overcome my lazyness.
     

Share This Page