- Home /
Question by
TheShinx93 · Nov 16, 2014 at 01:39 AM ·
c#imagebackground
help for the background image
Hello everyone I have a problem I can not solve I almost put a background image in a guibox, so that (using special script and running) will resize according to the screen resolution used. I tried to do so:
public Texture2D Wallpaper;
void Start ()
{
Wallpaper = Resources.Load ("Wallpaper/image1") as Texture2D;
}
void OnGUI()
{
GUI.Box(new Rect(0,0,Screen.width,Screen.height),Wallpaper);
}
but the result is this ...
I tried it with GUILayout.box but the 'image is slightly shifted from the coordinates x=0 and y=0 and largest of the game screen ...
public Texture2D Wallpaper;
void Start ()
{
Wallpaper = Resources.Load ("Wallpaper/image1") as Texture2D;
}
void OnGUI()
{
GUILayout.Box(Wallpaper);
}
I'm shooting for hours, but I found it on anything that can help me ... how can I do?
PS: sorry for my english
Comment