Clarification? touch is press,released,inside,outside

tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
edited November -1 in Working with GS (Mac)
Ok I have been messing with this Whats the difference in some of these? obviously release and press are opposites but as far as inside and outside and pressing in general. If i want to have to touch a specific actor to do by touch if i set it to just pressed will it react from a touch anywhere on the screen or only to the actor and if only to the actor then how is it different from touch inside the actor.
The reason i ask is i have been having some trouble with my game reacting how i want to touch. Sometimes it doesn't seem to detect it at all. I built my game with touch be inside the actor. Is it simply that touch inside mean that it will on react if the only touch on the screen is inside the actor?

Comments

  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    I'm pretty sure that an app opens in "touch released" state, so any actions that use that in the rules need to validate that a touch actually happened.

    I have been creating an attribute(self.pressed) that is switched to 1 when touch is pressed on the actor and then my rule that checks for touch is released also checks that self.pressed = 1. Then, the last thing I do within that rule is reset self.pressed back to 0.

    Anyone, please tell me if there is a better way! ;-)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    And I think it would be better to have the action happen on release as i have some object that are cleared by touch, and when i swipe my finger across the screen it clears some of them, but no usually all of them. thats partly where my question stems from as thats not really the idea behind the game. and then the other part is why does it clear some and not all from a swipe if my finger ran over the top of it?
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    "Touch inside" triggers action whenever the pressed mouse or any touch enters the bounds of the actor. Meaning, I can slide my finger or pressed mouse around the screen and activate actors that have rules set with "touch inside".

    "Touch pressed" only triggers the action when the mouse click or touch's origin is in the actor's bounds. Here, I have to start my click/touch ON the actor in order to activate it.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Ok that makes sense I like the way you said a second ago about press changing an attribute and then when release and attribute is 1 do whatever behavior. I think i will be adopt that route from now on. Thanks
Sign In or Register to comment.