knowing, which area in an actor will be touched...
MarcoCol
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?
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
Dan
@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?
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?
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?
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.