How do you enable multi-touch for a android app or game?

Is it just a line somewhere stating that it can happen- whats the deal???

Can’t find anything where someone knows what their doing- or any documentation stating whether it can happen or not- just people having theroies about it-

Its 2011 almost 2012- can we have two fingers on the screen at once operating or not??

All I see is people asking if it can be done or how to do it.

It just works given the device supports multitouch at all.

Older devices don’t have it, some have slightly bugged implementations as its not HW driven and some others just are cheap crap without multitouch capable screens nowadays. Such devices at times show that pretty well. if the google apps are lacking and it has no android market, it didn’t get certified by Google as Android device for a good reason (welcome to the world of open source)

Ok-

So from what I am getting from what you said- we do nothing as far as implementing it in our code, it just happens depending on the phone our apps or games are installed on that have that kind of functionality??

Thanks for responding-

I’m not sure we talk about the same thing.

Multitouch just works unless you disabled it (the enable Multitouch flag)

If it works you need to implement yourself what multiple touches are meant to do if thats what you really wanted to know.
If you don’t use the Input.touches or Input.GetTouch you naturally don’t have any multitouch at all.

Also no matter what you do, neither do OnMouse events work, nor will OnGUI accept multiple touches

Yeah- I’m back to where I started then-

So I am using OnGUI to operate GUI “touch” thumbpads, and I thinkt hat on my phone that I test with only allows me to touch one GUI button at a time- which isn’t very good- So I would have to rewrite the code with this Input GetTouch instead -??

Any examples of this in C# or anything- I can’t find squat-

Correct you will have to rewrite it.

As for examples in C#: porting that code from the iphone example warehouse and its guitexture touches is easy :slight_smile:

But simply put you just do a Stick.HitTest(touch.position) to see if its inside and then measure the distance to the center, with Stick being a guitexture.

LOL- dam I was hopeing I could just swap out a couple var’s and put it in an updat instead of the OnGUI-

I need help-

Look at the iOS sample projects in resources - examples at the top, explicitely the warehouse demo with its joystick classes to port from JS to C# easily

After the Lions game I’ll check it out.

Thanks buddy.

dreamora -

I don’t see a warehouse demo???

did you download the iOS examples?
the warehouse is or at least used to be one of the 5 example projects in there.

There isn’t a link for IOS examples there is 6 or so examples and none say warehouse- I looked all over and couldnt find a warehouse…unless I am blind-

Unity iPhone Examples - Its even linked straight on the examples page

Yeah I seen it after reading the fine print-

I don’t even know what I am looking for thou- I’m not even going to bother taking the js into my scene- I’ll just get a bunch of compiling errors-

I have no clue where to begin with this-

if your using unity OnGUI you wont get multi touch (or at least i dont know how to?), you need to either create GUI textures or 3d objects placed infront of a orthographic camera with screen point to ray

Thats correct pat, if oyu are using OnGUI you will not get multitouch no matter what. OnGUI only reacts to the mouse which on touch devices is equal to touch 0, or if multitouch is disabled to the weighted center of all touches.

The normal way to go is either work with guitextuer and its hittest against the touch position, or to use something like EZGUI that offers more or less a complete gui framework purely on optimized meshes etc

or naturally you can go with the platforms native UI

I actually bypassed all the multi-touch bs and went with the accelerometer- now only need one button…

Good to know thou-

I use a Sony ericcson X 10 and my phone hasn’t got the multi touch option. It’s also a very big disadvantage.

ehm didnt read anything but with your onGUI i use GUITextures and use this code to test if it hit (and yes WITH multitouch so multiple things at once can be touched)

this is my code for the menu and stuff so just replace the things you want

if(touch.phase == TouchPhase.Began  play.HitTest(touch.position))
{ 
	Application.LoadLevel(1);
	move = true;
}
if(touch.phase == TouchPhase.Began  options.HitTest(touch.position))
{ 
	MMove = true;
}
if(touch.phase == TouchPhase.Began  quit.HitTest(touch.position))
{ 
	Application.Quit();
}

I will suggest using UITool Kit or XTUIO as a starting point for supporting multi touch UI.
UI Tool Kit pretty difficult to use, but good performance.
XTUIO pretty easy to use(Specially 3D UI), but it is GPL and you need some work to make it working with touches.

Some devices with 2 point multi touch will mark as not supporting multi touch on market, but pretty low share as a whole.