BASIC

Author Topic: 2 point multitouch  (Read 1279 times)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1442
    • View Profile
2 point multitouch
« on: 2013-Dec-15 »
I have a new acer z3 and it only has 2 point multitouch but its enough for my game but the get mouse routine isn't working as expected.

How should I code it for 2 point touch?

Thks
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3606
    • View Profile
    • Space Fractal
Re: 2 point multitouch
« Reply #1 on: 2013-Dec-15 »
Some Android Devices have pretty much very bad multi touch support or not working as you should. You have property faced this bug (not extractly your model, but you have the idea):
http://www.youtube.com/watch?v=FNcD7AYjrws

If that happens on your phone, there is nothing Gernot can do at all, due that is just bad implemented on the hardware its self. That why some multi touch based apps on android see buttons on top left and button right, or something like that to avoid like that.

here is what im does for checking:

Code: GLBasic [Select]
FOR i=0 TO GETMOUSECOUNT()-1
        SETACTIVEMOUSE i
        MOUSESTATE mx, my, mba, mbb
        // some input retine here.
NEXT
 
[/code]
« Last Edit: 2013-Dec-15 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1442
    • View Profile
Re: 2 point multitouch
« Reply #2 on: 2013-Dec-15 »
Thanks SF,

I do that also - but i just found out its a bug on the Z3 on portrait mode for the x-axis...
I am installing an update and hoping that'll fix it...(*nope* didnt fix - not sure if considered as a bug or just a limitation now)

I usually do a boxcoll with the mouse coords like so...find it neater than all the "if greater than" etc..

Code: GLBasic [Select]
//within getmousecount loop
IF BOXCOLL(10,shipy+60,70,60,mxx,myy,5,5) AND mb1=1
          shipdir# =  -(2.0*speed*extraspeed)
       
        ELSEIF BOXCOLL(90,shipy+60,70,60,mxx,myy,5,5) AND mb1=1
                  shipdir# =  2.0*speed*extraspeed
       
        ENDIF

I dont want to have to use more screen area for my controls...want to have them all on the bottom...
« Last Edit: 2013-Dec-15 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3606
    • View Profile
    • Space Fractal
Re: 2 point multitouch
« Reply #3 on: 2013-Dec-15 »
Im have not see your game in action, so im are not sure you planning do 4 or 8 way game?

You should been aware this kind of Multi Touch issues, which you cant avoid, if you placed all buttons in the bottom. A easy fix is simply let user move the controller in a config. My games do also placed all buttons in buttons too, but is not true multi touch game anyway and then its would not intefere.

Im are not sure what you mean with portrait mode? IF you set orientation by your self, im remeber (but im do not sure here throught) you need to orientation your cords by your self. Which that in mind, try Draw a circle where finger is touched and let Draw the coll boxes to the screen, so you easer can debug, what its really happens.

« Last Edit: 2013-Dec-15 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1442
    • View Profile
Re: 2 point multitouch
« Reply #4 on: 2013-Dec-16 »
Thanks Spacefractal,

I'm glad I found out about it before going live...I have amended my controls to accept this.

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs