Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Touches (Auto) Offset on iPad

There is almost no information out there about this, so here is my problem:

I'm working on a 2 player 'sit across from eachother' ipad game and the player who is on the opposite side has a hard time tapping buttons... because it appears that Apple auto-shifts the touch based on the device orientation (which is great for regular use or the main player). Is there any way to reset it or tell the ipad to not do that? (Btw iPhone does this too)

This is all I have found: Given this apparent inconsistency, I've decided to just cheat it by opening up the moving parts' 'bounds' so that there is an area for the user to hit below the part's area. On the whole, users seem to hit below an object rather than above it - so don't notice the shifting caused by iOS as much.

So if there is no easy way to prevent the offsetting, is the only solution to shift each uiview's (or subclass's) bounds for the opposite player? Or is that even correct?

Any answers appreciated.

like image 856
cclogg Avatar asked Oct 24 '11 04:10

cclogg


People also ask

Is there a way to adjust touch sensitivity on iPad?

Go to Settings > Accessibility > Touch > Haptic Touch. Choose the touch duration—Fast or Slow. Test your new settings on the image at the bottom of the screen.

How do I make my iPad touch screen not respond?

It's under the "Physical and Motor" header. Tap 3D & Haptic Touch on the menu. This opens your touch sensitivity settings. Tap the 3D Touch switch to turn the feature on or off.


1 Answers

Yes, the touch offset does exist, its size is not documented and it cannot be cancelled (at least, with public API).

You have to reverse-engineer the offset itself. I would just display a small circle where UIKit says the touch is, and then adjust it by trial and error. When you have the offset, you can manually apply it (-2 * offset) in the event handlers for the opposite player only.

I can't tell how right it will feel, you have to experiment a bit.

like image 187
Costique Avatar answered Sep 28 '22 09:09

Costique