2D Toolkit Forum

2D Toolkit => Support => Topic started by: tobia88 on December 01, 2013, 06:48:28 am

Title: How to disable ui multi touch?
Post by: tobia88 on December 01, 2013, 06:48:28 am
I'm pretty new in 2dtoolkit, now i have an issue while i'm managing my buttons, i have made sure the Use Multi Touch check box in tk2dUIManager is unchecked, but i found the button is still trigger multi touched on my iPad, i need help!! :'(
Title: Re: How to disable ui multi touch?
Post by: unikronsoftware on December 01, 2013, 12:15:30 pm
When multitouch is turned off, tapping with another finger will untrigger a previously triggered button. What kind of behaviour are you looking for?
Title: Re: How to disable ui multi touch?
Post by: tobia88 on December 02, 2013, 06:00:45 am
I'm using 2dtoolkit for education application development, it's really an awsome plugin for making a 2d view application in unity!

There are few buttons displayed on the screen, and my major bug is when i'm touching setting button and restore button in the same time, they both triggered! I had set Unity default api Input.multiTouchEnabled to false and make sure tk2duimanager is not using multi touch, but the issue cant be solved.
Title: Re: How to disable ui multi touch?
Post by: unikronsoftware on December 02, 2013, 06:22:38 pm
When multitouch is disabled, it will currently will override a second touch. That means that if you tap button A, then while holding that down, tap B, it will unclick A and click B.
You can try to change the code in tk2dUIManager (line 416) to make it not do that - I've not tested it though.
Code: [Select]
                if (pressedUIItem != null)
                {
                    pressedUIItem.CurrentOverUIItem(hitUIItem);
                    if (pressedUIItem != hitUIItem)
                    {
                         return;
                    //   pressedUIItem.Release();
                    //    pressedUIItem = null;
                    }
                    else
                    {
                        firstPressedUIItemTouch = resultTouch; //just incase touch changed
                    }
                }
Title: Re: How to disable ui multi touch?
Post by: jacky on December 05, 2013, 02:41:13 am
I am having the same issue and I used that code and it makes all of the buttons stop working and one button plays it's sound. I would probably be here for a while trying to figure out everything that is going on in that code. Any ideas?

Unfortunately, I can't send my project and a repro case would take forever so that makes things a bit tough. Hopefully either tobia88 got it working or Unikron, perhaps you have some idea of what could be causing it.