I am trying to make a pixel game with Unity 4.3.3f1 and the 2D tools.
I have a background sprite (BG) that is 512 x 128 pixels. I have an avatar sprite (EGO) that is 16 x 32. For both sprites the Pixels To Units has been set to 1, the Filter Mode has been set to Point, and the Max Size has been set correctly (512 for BG, 32 for EGO), with the Format set to Truecolor.
The GameObjects containing the BG and EGO have been placed in the scene using whole numbers for position, and the Main Camera’s Orthographic Size has been set to 40 (the iPhone 5S resolution is 1136 x 640, divide that into 8 x 8 cubes and you get 142 x 80, which is what the game’s native resolution is meant to be, and my admittedly limited understanding is that you want to set the Camera Size to half the vertical height of your intended resolution).
When I set the Game window’s output resolution to a fixed 1136 x 640, this is what I see:
It’s actually kind of hard to see here, but there is 1 row of pink pixels at the very top, you can see a full sized version of that image at http://iammichaeldavis.com/staging/problem-example.png.
So everything is offset vertically by one pixel, and I have no idea why. I am a complete Unity newb so it’s entirely possible I’ve overlooked one super obvious piece of information, so I apologize if this is a stupid question. I searched for pixel art in the archives but it seems like since these 2D tools are so new people are still kind of figuring them out? I’ve also uploaded a .zip file of the project itself, which is at http://iammichaeldavis.com/staging/pixel-unity-problem.zip.
My knee-jerk guess was that it was a stretching issue, and Unity was stretching the background differently than the EGO sprite, so I took a screenshot into Photoshop and almost all the individual pixels of the originals do appear to be scaled up to an exact 8 x 8, except for the bottom row of the EGO sprite (which is only 7 pixels tall):
So, something is definitely off with the scaling. Is this a known issue?