multi touch controls advice wanted (not joystick..)
old_kipper
Member Posts: 1,420
HI, want to control 2 atributes from two fingers in 2 areas of the screen, with a third button to fired off other events. I have version working for two fingers by having 2 actors that each have rules for touch one and two (excluding the second touch while outside of the desired actor), but not for a third touch and for ordering the touches so everything still works.
This seems much like the joystick control problem but pushed to add another touch. Is there a template for multitouch that sets up any touch as the master when it is in an area? Or perhaps I just need help/brain transplant/coffee/a good sleep.
Thanks for any help Kipper
This seems much like the joystick control problem but pushed to add another touch. Is there a template for multitouch that sets up any touch as the master when it is in an area? Or perhaps I just need help/brain transplant/coffee/a good sleep.
Thanks for any help Kipper
Comments
Create 3 game attributes (Touch 1, Touch 2, and Touch 3), 1 for each actor, to track whether touch is on or off.
In Touch 1 actor:
Rule 1: If touch is pressed,
- change game attribute Touch 1 from 0 to 1.
- Rule 2: if Touch 2 and Touch 3 are 0, change self attribute Touch Order to 1
- Rule 3: if Touch 2 is 1 and Touch 3 is 0, change self attribute Touch Order to 2
- Rule 4: if Touch 2 is 0 and Touch 3 is 1, change self attribute Touch Order to 2
- Rule 5: if Touch 2 and Touch 3 are 1, change self attribute Touch Order to 3
Otherwise:
- change game attribute Touch 1 to 0
- change self attribute Touch Order to 0
Set each button up like that. If you need to access the Touch Order outside the individual actor, then you'll probably need to create 3 game attributes (Touch Order 1, Touch Order 2, and Touch Order 3), one for each actor, that track the order the button was touched in.
I had tried to monitor touches within regions with a select for the first until it was false, by leaving the region, and putting timers in to check position of each touch to see if it was the one I wanted to use... It was getting maddening.
I did have a conversation with a friend who does coding in a mix of open frame works and objective c plus another I can't tool remember and he said that the ios devices do return a event set for each touch, with an release within the event stream for that touch so at that level it can be done. Perhaps in the big version 1 of GS? There was one post I saw from one of the GS chef that mentioned the complexity of setting it up (if I read it correctly...guess I didn't understand what was being said as I just assumed it was in here somewhere ).
SO thanks again Kipper