Page 1 of 1

Mobile device multi-button best practice

Posted: 28 Feb 2014, 09:38
by Mikael Gyth
Hello.
I've encountered a small problem while working with NoesisGUI on a project.
We wanted to display three buttons on screen, one for speed and two for right and left.
They are to be used on mobile devices, so they will receive input from a touch screen.
I made them RepeatButtons, and i hook up a handler to the Click event on each button. This works fairly well, however the problem is that the player will need to be able to press the "Speed" button at the same time as one of the left/right buttons. And with the current configuration, when I hold one button and press another one, the first button stops firing events.

Can anyone give me some advice on how to fix this, and if this is even the right way to do it?

Re: Mobile device multi-button best practice

Posted: 28 Feb 2014, 17:17
by jsantos
Hi Mikael,

You are doing it right. The problem is that our buttons are not multitouch aware, they are handling only the mouse event (touch events are converted to mouse events when not handled) and the mouse can only be located in one position at the same time.

For now, you could hack it by attaching to the TouchDown event of the button or if you are not in a hurry wait for us to solve it. It has been reported by more customers.

Re: Mobile device multi-button best practice

Posted: 03 Mar 2014, 08:47
by Mikael Gyth
I was considering just setting boleans with the touch down and touch up evens and firing commands from the Update while the boolean is true. This would also set the rate of commands sent to the same rate as the input from Axis in Unity.
Sounds like a good solution?

Re: Mobile device multi-button best practice

Posted: 03 Mar 2014, 20:40
by jsantos
I would take the faster solution. Don't dedicate time to find an elegant way because as I said we are going to fix this. So, if that is working for you I will leave it as it for now.

Re: Mobile device multi-button best practice

Posted: 06 Mar 2014, 19:33
by Mikael Gyth
Hello.
My solution did work reasonably well, but was very unstable (Sometimes the events would not register and booleans would get "stuck".
I know it's hard to tell but when would you estimate that multitouch will be adressed in NoesisGUI?

Re: Mobile device multi-button best practice

Posted: 08 Mar 2014, 20:15
by jsantos
I don't understand why the solution is unstable. Could you ellaborate it a bit more? Let me see if I can help.

This multitouch issue is planned to be solved in noesisGUI v1.2 whose release date is estimated to be at the end of this month. Although it will be probably delayed. The beta will be sooner, I will try to provide you one as soon as this feature is incorporated for testing.