- Home /
How do I take maximum screenspace for Gui
I have been trying all day to have a Gui Texture 2D pop up and fill the screen. For some reason, using Screen.width and Screen.height is not working. I've stripped the code to the bare minimum (just displaying Gui) (the pixel values for length and width were arbitrarily chosen). If someone could tell me how to have the Texture 2D fill the screen, that would be fantastic.
function OnGUI () {
if (canrun == false) {
return;
} if (ScaryImageChoice1.scaryimage1bool == true) {
GUI.Label (Rect (0,0,320,480), scaryimage1);
}
else if (ScaryImageChoice1.scaryimage2bool == true) {
GUI.Label (Rect (0,0,320,480), scaryimage2);
} else if (ScaryImageChoice1.scaryimage3bool == true) {
GUI.Label (Rect (0,0,320,480), scaryimage3);
}
}
Comment
Best Answer
Answer by LucasVmarrewyk · Sep 06, 2014 at 04:08 PM
up first i think you should use GUI.DrawTexture and then this should work
GUI.DrawTexture(Rect(0,0,Screen.width, Screen.height),scaryimage1);
good luck
Your answer
Follow this Question
Related Questions
How to save screenshot then use it as a gui texture? 2 Answers
GUI Label "flash a Arrow" 1 Answer
more guitexture in void ongui 1 Answer
Assiging an Image to a Button 1 Answer
Best way to show an image 2 Answers