Remote bug with touch position?

I am seeing weird behavior with the remote and iPhoneTouch.position. It looks like the x value of the position has 300 added to it.

Here are the values I get touching the corners of the screen, with a horizontal orientation:

touch lower left: (304,3)
touch lower right: (758,7)
touch upper left: (306, 307)
touch upper right: (758, 309)

If I build my app and deploy it on the Ipod, it works correctly. I am running 1.01 and the player that came with it.

Am I doing something dumb, or is it broken?

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.

Ah…obviously!

Thanks

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 the whole preview area of the desktop is mapped onto the iphone.

The editor offers a pretty simple dropdown to set the right mode with correct resolution.

There is no problem with 2:3 or 3:2, the problem is incorrect sizes of the canvas.

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