- Home /
[BUG] onGUI display bug on iphone 5 and Nexus 7 (display won't fully stretched)
Hi! Thank you for coming by... Let's get started, i've made a game and there's a problem on it, the display is weird and it's like the screen won't fully stretched... When i use Windows build, it's fine, but when i change the build into android, it's weird... The build is still in unity system build... But when i export the game to mobile, only some mobiles like iphone 5 and Nexus 7 that got this problem... We're using onGUI function and some people said that it's old and not good to be used nowadays... You can see the game's problem in pictures and C# code in the attachment below... This is the url of the pics just in case you can't see them all below... https://postimg.org/image/jt7jwjojx/ https://postimg.org/image/d410gj37x/ Thank you so much...
using UnityEngine;
using System.Collections;
public class TestScript : MonoBehaviour {
private Texture2D bg;
// Use this for initialization
void Start () {
bg = (Texture2D)Resources.Load ("bg");
}
// Update is called once per frame
void Update () {
}
void OnGUI(){
GUI.DrawTexture (new Rect (0, 0, Screen.width, Screen.height), bg);
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612091928im_/https://answers.unity.com/themes/thub/images/avi.jpg)