Using Screen.width is not future-proof. Instead, use Screen.dpi to detect the actual pixel density of the display.
Attach this script to any GUITextures you use in your game.
void Start () {
//check for retina display
bool isRetina = Screen.dpi >= 150;
if (isRetina) {
// double pixelInset if we're using retina
Rect pi = guiTexture.pixelInset;
guiTexture.pixelInset = new Rect(pi.x*2, pi.y*2, pi.width*2, pi.height*2);
}
}
↧