When using multiple touch, is there a way to specify a certain thing you want touched, such as an active? Or does it only record touches made anywhere on the frame?
Printable View
When using multiple touch, is there a way to specify a certain thing you want touched, such as an active? Or does it only record touches made anywhere on the frame?
Create another active object, called TouchZero, TouchOne etc etc, which is 1 pixel by 1 pixel, then:
+ [Multiple Touch] Touch 0 is active
- [TouchZero] Set X Position to XTouch( "Multiple Touch", 0)
- [TouchZero] Set Y Position to YTouch( "Multiple Touch", 0)
+ [Multiple Touch] Touch 1 is active
- [TouchOne] Set X Position to XTouch( "Multiple Touch", 1)
- [TouchOne] Set Y Position to YTouch( "Multiple Touch", 1)
Etc, etc.
Then just test to see if the Touch active objects overlap the other active object.
How do I make it so it can handle two touches at once?
To clarify more, in my game movement is controlled with two left and right arrows and a jump button. While the user is moving left and right I also want them to be able to jump.
Anyone know how to make multiple touch capable of handling two touches at once?
First, make sure your Frame has "multitouch" set (it defaults to single touch). Then you need to check which touch was made. There are a couple examples in the examples section that show you an easy way to do it.
Instead of "TouchOne" and "TouchZero" I just create instances of the same active object with a spread value and set them to the touch position of that spread value, then check for overlap events. I usually make the object bigger than 1 pixel too, more 'finger size'.
Is it possible to request an event like "touch (x) is/is not over "Active"? This would save us all using more useless actives.
Yes, it is in the making, and much more.
Great! Thanks Francois :)