Page 1 of 2

Quick question about iPhone's multi-touch

PostPosted: Mon Nov 15, 2010 11:53 pm
by Game A Gogo
Is it possible to get the finger's position (with xmouse and ymouse) when he drags it on the screen?
Something like you aim with one finger and you use another to shoot (Of course shooting would probably make the cursor jump, but I can work around that)

Not sure if this has been covered yet, I checked in the forums, but it was only about multiple clicks detection.

Re: Quick question about iPhone's multi-touch

PostPosted: Tue Nov 16, 2010 12:08 am
by skydereign
Well since I don't have an iPhone to test, I haven't been able to fully explore multitouch, but only one click is received by an actor. That actor can see those xmouse/ymouse values, but I believe no other actor can (this might not be the case but I don't see how it could be done cleanly if there are two clicks being watched). If you want to see another actor's xmouse/ymouse you could always set two actor variables. Sorry I can't be more specific, but xmouse and ymouse do work to some extent. I used them for the classic dual joystick controls in a lot of iPhone games.

Re: Quick question about iPhone's multi-touch

PostPosted: Tue Nov 16, 2010 12:42 am
by zxcvbnm
You can touch 3 or 4 points on the screen at once. I tested this on ipod .

Re: Quick question about iPhone's multi-touch

PostPosted: Tue Nov 16, 2010 10:38 am
by Game A Gogo
zxcvbnm wrote:You can touch 3 or 4 points on the screen at once. I tested this on ipod .

I knew this already

Skydereign: I'll have to hope what I'll attempt works then, I don't have an iPhone either. I wanna try making a space shooter for it, I want the player to move depending on where the finger on the screen is, unless he clicks on the buttons to change weapon/shoot. Thanks though!

Re: Quick question about iPhone's multi-touch

PostPosted: Wed Nov 17, 2010 8:08 am
by skydereign
That's pretty easy to do, and translates well to iPhone. As long as the button sets some variable used by the actual move/aim/shoot mechanic, its just like single touch.

Re: Quick question about iPhone's multi-touch

PostPosted: Sun Jan 02, 2011 2:38 am
by Kodo
I've been searching the forums for a while tonight and haven't found what I'm looking for yet :( I have a platform game that includes a joystick and a jump button, they work fine on their own, but when you're using the joystick to move pressing the jump button interferes with the joystick, as though you are no longer using it, then as soon as you release the jump button the joystick starts working again.

The joystick checks the x & y position of the mouse when the finger is moved around on the sprite (Mouse Enter/Leave events), i think that when I press the jump button (Mouse Down Event) on the other side of the screen those mouse x & y cords suddenly register as being outside of the joystick area and cause the joystick to glitch. Has anyone come up with a good way to handle this kind of multi-touch control yet? - I've even tried detecting mouse movement for the joystick on the sprites draw event, which works but results in the same problem :(

Re: Quick question about iPhone's multi-touch

PostPosted: Sun Jan 02, 2011 1:19 pm
by Kodo
I've abandoned the idea of using a 'joystick' on which you hold down your thumb and move around (much like a D-Pad) and have instead gone with simple buttons for left, right and jump. Though it's not what I originally wanted it is working just fine :)

Re: Quick question about iPhone's multi-touch

PostPosted: Thu Feb 03, 2011 1:03 pm
by Chai
Kodo wrote:I've been searching the forums for a while tonight and haven't found what I'm looking for yet :( I have a platform game that includes a joystick and a jump button, they work fine on their own, but when you're using the joystick to move pressing the jump button interferes with the joystick, as though you are no longer using it, then as soon as you release the jump button the joystick starts working again.

The joystick checks the x & y position of the mouse when the finger is moved around on the sprite (Mouse Enter/Leave events), i think that when I press the jump button (Mouse Down Event) on the other side of the screen those mouse x & y cords suddenly register as being outside of the joystick area and cause the joystick to glitch. Has anyone come up with a good way to handle this kind of multi-touch control yet? - I've even tried detecting mouse movement for the joystick on the sprites draw event, which works but results in the same problem :(


I'm facing the same problem too.

Re: Quick question about iPhone's multi-touch

PostPosted: Thu Feb 03, 2011 4:26 pm
by again
Thats wierd Iam trying to understand what you guys are asking but i can't. If you have an actor and lets say you have a forward button and jump button when you press them at same time they both work. Can you and chai please explain question better so I can understand.

Re: Quick question about iPhone's multi-touch

PostPosted: Thu Feb 03, 2011 4:44 pm
by savvy
on the joysticks, use distance and direction functions to get it right, as in my prinny pals 2 game, where the joystick moves the blocks. however the speed only has 1 minor adjustment on the actual joystick, the rest of the speed is up to the speed-ometer on the right hand side.
http://game-editor.com/forum/viewtopic.php?f=4&t=9962

here is the tutorial for the joystick.
http://game-editor.com/forum/viewtopic.php?f=4&t=9989

Re: Quick question about iPhone's multi-touch

PostPosted: Thu Feb 03, 2011 9:17 pm
by Kodo
Hi Savvy, thanks for the post, but getting a joystick to work is no problem, the problem is when you are controlling something with the joystick and then at the same time press somewhere else on the screen to activate another button. Your tutorial while good suffers the same problem when tested on iPhone. IE. when you are controlling your car with the joystick, then press another button (I added one on the other side of the screen) the joystick registers that you have pressed the far side of the screen and the car zooms to the right, even if you are holding the joystick left :(

Re: Quick question about iPhone's multi-touch

PostPosted: Fri Feb 04, 2011 1:53 am
by Chai
Kodo wrote:Hi Savvy, thanks for the post, but getting a joystick to work is no problem, the problem is when you are controlling something with the joystick and then at the same time press somewhere else on the screen to activate another button. Your tutorial while good suffers the same problem when tested on iPhone. IE. when you are controlling your car with the joystick, then press another button (I added one on the other side of the screen) the joystick registers that you have pressed the far side of the screen and the car zooms to the right, even if you are holding the joystick left :(


Yes, Kodo's experience is right.
I plan to use my left finger to control a spaceship with drag and drop.
and my right finger to use a bomb with a button.
Then, if I put two things in the same time. Then, the problem is up.

Re: Quick question about iPhone's multi-touch

PostPosted: Sat Feb 05, 2011 7:57 pm
by Game A Gogo
Have you tried doing actor.xmouse and actor.ymouse, maybe that could work? of course change actor for the joystick actor...

Re: Quick question about iPhone's multi-touch

PostPosted: Sat Feb 05, 2011 11:20 pm
by sonicfire
we definately need real multitouch support :)

EDIT: do we have any advantage of using left and right mousebutton events/clicks? would this make multitouch work better in some way?

Re: Quick question about iPhone's multi-touch

PostPosted: Thu Feb 10, 2011 12:07 pm
by sonicfire
anyone knows if makslane is still around?? havenĀ“t heard from him for a long time now :(