register a second touch on same button

gamedivisiongamedivision Member Posts: 807
edited November -1 in Working with GS (Mac)
i would like to use a button to bring an actor on the screen so touch 1 brings actor on, touch 2 send actor of the screen.not sure how to register a second touch
any help is appreciated

Comments

  • mangaroomangaroo Member Posts: 419
    its quite a different request from the topic (edit not anymore! seems its changed) but touch can exist as total number of fingers touching the active screen (Device->touch count)

    or it can be the specific touch-
    touch1 x+y
    touch2 x+y
    etc

    1 being the first finger that touched the screen 2 being when 2 fingers are on screen, the second finger's position - there is also touch being released and touch pressed which are conditions found when making a new rule condition that is not an attribute

    basically for the thing you want to put on screen make a rule that says (when (integer) attribute 'whatever' is 1)
    move, fade in or change attribute or *interpolate x+y position to
    otherwise
    move/fade out or whatever

    then rule for your touch button : when pressed change the integer whatever to (whatever+1)%2

    that will change whatever to 1 then 0 then 1 then 0 everytime it is pressed, when its 1 the object will move blah blah
  • gamedivisiongamedivision Member Posts: 807
    mangaroo said:
    its quite a different request from the topic (edit not anymore! seems its changed) but touch can exist as total number of fingers touching the active screen (Device->touch count)

    or it can be the specific touch-
    touch1 x+y
    touch2 x+y
    etc

    1 being the first finger that touched the screen 2 being when 2 fingers are on screen, the second finger's position - there is also touch being released and touch pressed which are conditions found when making a new rule condition that is not an attribute

    basically for the thing you want to put on screen make a rule that says (when (integer) attribute 'whatever' is 1)
    move, fade in or change attribute or *interpolate x+y position to
    otherwise
    move/fade out or whatever

    then rule for your touch button : when pressed change the integer whatever to (whatever+1)%2

    that will change whatever to 1 then 0 then 1 then 0 everytime it is pressed, when its 1 the object will move blah blah

    thank you mangaroo works a treat
  • mangaroomangaroo Member Posts: 419
    no worries, that % is a useful tip i picked up from tsb
Sign In or Register to comment.