Hello Guest

Author Topic: How to disable ui multi touch?  (Read 6708 times)

tobia88

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
How to disable ui multi touch?
« 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!! :'(

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to disable ui multi touch?
« Reply #1 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?

tobia88

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to disable ui multi touch?
« Reply #2 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to disable ui multi touch?
« Reply #3 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
                    }
                }

jacky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: How to disable ui multi touch?
« Reply #4 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.