knowing, which area in an actor will be touched...

MarcoColMarcoCol Member, PRO Posts: 279
currently I have two actors for controlling the actor left or right.
I add the rules, that if the user touch is pressed or inside, then an attribute changes.
Also that if the user touch is released or outside, then the attributes changes back.
Everything works fine. Simple!
I have another pedal for changing the speed. So if I touch one of the direction actors and with another finger I move the pedal, in just this moment the attribute for the left or right direction changes to 0, because I touch anywhere outside.
But this rule is important, knowing when move the touched finger from the left to the right-field, without release it.

So I ask me what to do and maybe I think to complicated, but I found no way.
Now I ask you, if it is possible to set only one actor for the left/right-controlling, where I can add all rules. Also where I know which point was touched, and if it is the left area, then attribute left=1 & right=0 and for the right area the other comination.
Can this let this work, also with the pedal? Is this possible?

Comments

  • ericzingelerericzingeler Member Posts: 334
    Well, why not just use touch pressed for buttons and drop the inside/outside?
  • ironDanironDan Member Posts: 148
    Sounds like a Multi-touch issue. In your Direction actor add the Rule If touch is pressed and inside and then (in the device.touch count) add Touch count is = or > 1. And then in your speed actor add the Rule if touch is pressed and inside and then (in the device.touch count) add Touch count is = or > 2.

    Dan
  • MarcoColMarcoCol Member, PRO Posts: 279
    @ericzingler: because then it doesn't work, if the player moves unnoticed his finger to another button...
    @ironDan: yes, that's the issue. I didn't understand your description.
    First, I add the rule if touch is pressed and inside (as "any"), right?
    And then, what exactly happened, when I do this, to understand you?
    If the user touch the direction actor, it count the touch and this is then=1. And when he additional touches the speed-actor it is then = 2.
    What happens, if the player (and he should can do that) doesn't touch the direction(s) actors and only touch the speed-actor? Then the player should move the main actor only forward or back, without left or right... Does this work too?
  • MarcoColMarcoCol Member, PRO Posts: 279
    So I add in both direction actors the pressed & inside with ANY. Also next then the Touch count = or > 1.
    In the speed-pedal I add also pressed & inside with ANY and the Touch count = or > 2.
    The directions work, but not the speed pedal...
    Or did I understand it wrong?
  • MarcoColMarcoCol Member, PRO Posts: 279
    Any more idea?
  • MarcoColMarcoCol Member, PRO Posts: 279
    I've tried it now with:
    The ouchable Actor has the size of 90 x 80 px.
    if touch is outside AND game.touch.Touch1.X > 1000 AND game.touch.Touch1.X < 900 AND game.touch.Touch1.Y >10 AND game.touch.Touch1.Y < 100.
    Then change att......
    So my plan was to get the position of the moved finger. Is it outside (with a small border around the actor), then it should set to 0. And if the finger moves inside the actor, everything is fine and it is set to 1.
    But it doens't work.
    Also I set for the first Move-actor the game.touch.Touch1.X/Y and for the second game.touch.Touch2.X/Y

    Has anyone an idea how to fix this multi-touch-issue?
  • MarcoColMarcoCol Member, PRO Posts: 279
    edited June 2013
    Ok. I foind an easy way:
    I create an actor and put it four times around the right/left actor.
    If user move finger over it, then change att left/right to 0.
    Works good. Maybe all my other thinkings was to detailed/complex...
    Thank you for help.
Sign In or Register to comment.