Touch controls question

madmasseymadmassey Member Posts: 55
edited November -1 in Working with GS (Mac)
Hey guys, quick question. I'm using "actor receives event, touch, is pressed" to trigger an event. The problem is, if I keep my finger pressed on the trigger actor, it keeps triggering the event over and over. Even if I drag my finger around on the screen, it still thinks I'm pressing on the original coordinates.

I have boolean checks on my triggers, but in this particular instance this one spot is the button press needed to both turn on and off the boolean.

The behavior I'm looking for is similar to how it works in Secret of Grisly Manor. You can click and drag on a hotspot to get a text description or whatever, and the action happens instantly on the finger press, but if you drag your finger around it never activates anything else accidentally. I'd appreciate any help you guys could give.

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Not 100% sure what your after but...

    Maybe you have 5 texts and you need an integer "showText"

    If actor text1 is pressed change showText to 1, then if text is closed change showText to 0.

    Then on the text actors do if touch is pressed and showText=0.....show text, this will make sure only 1 text can be viewed at a time.

    Darren.
  • madmasseymadmassey Member Posts: 55
    Simply put, I'm trying to have a touch event that doesn't constantly refire until you lift your finger from the screen.

    An example - You have a button that brings up text, and the same button closes text. You want to be able to press the button and have it display the text instantly, but then you want the player to have to lift up their finger and press again in order to close the text... then lift up the finger and press again to open the text.

    A boolean alone doesn't seem to do the trick, because the event to change the boolean to 1 and then 0 again are bound to the same button.
  • madmasseymadmassey Member Posts: 55
    I guess I could have a boolean like "IsPressing" that sets 1 for a "pressed" action and 0 for a "released" action but that seems kinda unstable, heh. Guess I'm just wondering if I'm missing something simple.
Sign In or Register to comment.