Make sure you’re using a single preview viewport in Unity that is set to one of the iPhone “aspects” (i.e. iPhone Wide or iPhone Tall). If you don’t have this set, the pixel-to-pixel relationship will be all off.
Why should this be the case? Having iPhoneTouch.position work differently in two dimensions, and having the editor not work, in maximized mode, does not make any sense. Right now, iPhoneTouch.position.x reports the width of the viewport, minus the width of the iPod screen (480), plus the actual iPhoneTouch.position.x on the iPod. iPhoneTouch.position.y reports the same (correct) thing regardless of viewport size.
We could code around this, but I think what’s going on with iPhoneTouch.position.x is broken, so I doubt the code we would write now would be future-proof. I’m filing a bug report on it. It doesn’t make sense for the x and y values to be computed differently, and I want to be able to run games in maximized mode (at 3:2, anyway. And I hope we get a 2:3 mode).
The problem is that iPhoneTouch.position is implemented differently for x and y!
If it is standardized, we can code around it. I’m already using Screen.width and Screen.height everywhere in my iPod code, because I assume we will have higher resolution devices in the near future.
Sounds like a bug with the editor not the iphone side.
I don’t see why the viewport would be taken into account at all. I want to get the coordinate on the iphone as result not some virtual crap.
Its unitys job to interpolate the iphone touch coordinates to the viewport size behind the scenes, but it definitely must not affect the code as the viewport does not exist at all for the iphone
I actually highly doubt that higher resolution iphones will come anytime soon and if, it won’t make a difference to the games as the iphone would just scale the rendered output but remain the same calculation wise. And thats granted, as apple put quite some effort in pushing the itouch / iphone as gaming device and they can’t afford to have all current games beeing incompatible with a new device