Is there a way to capture in units pixels for 2D games. So the iPhone screen is 480x320. I want to move an object to the top left corner. To achieve that I move the object to x0,y0. My question is is there a way to move objects by pixels within a virtual iphone screen size? If no, how could I make a virtual iphone screen and use coordinates (like I would in Cocos2D or Core Graphics). I’ve made a few 2D games in Unity, but no object positioning is ever 100% precise in scale and position. I usually have to manually move cameras, zoom in and out, scale textures etc. I just want somehow to make unity3d more 2d friendly.
If you want 1:1 pixel/unit ratio create an orthographic camera with an orthographic height of 50% of your vertical screen resolution.
example:
iPhone 3GS Portrait resolution is 320x480
Orthographic camera size/height should be set to 240.
I personally prefer using a 100:1 pixel/unit ratio.
in the previous example you would set ortho height to 2.40 to achieve this.
if you move an object 1 full unit to the right; it will move 100 pixels. rotated objects may be off a bit due to edge aliasing obviously - but this is a nice way to “Emulate” an iDevice screen using a 2D environment.