Quantcast
Channel: Answers by "pixel_fiend"
Viewing all articles
Browse latest Browse all 18

Answer by pixel_fiend

$
0
0
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); } }

Viewing all articles
Browse latest Browse all 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>