- Home /
Getting the right sprite texel to screen pixle ratio with iphone 6 as base resolution.
I am working on a 2D game and trying to get the resolution for my 2D sprites right. I am using iPhone 6 as my base resolution which is 750 x 1334. My orthographic camera has a size of 30, so vertically a total of 60 units. So 60 units encapsulate 1334 pixels, so 1 unit has 22.23333... pixels which is worrying as I don't get an integer number. I have pipe sprites that vertically need to take 10 units, so 6 pipes fit vertically (as screen is 60 units). My pipes are 341 x 786 in size. The Pixel Per Unit setting is set to 78.6 so that one sprite (786 px in height) fits 10 units. So this makes my sprite pixel to screen pixel ratio to be: 78.6 sprite pixel = 22.233 screen pixel 1 sprite pixel = 22.233/78.6 screen pixel
Here is a screenshot of how my pipes look on current scene setup:
I know that i need to have this ratio be an integer so that I have pixel perfect art and dont see artifacts. Can someone help with determining this better. Thanks for any help in advance.