- Home /
How can i remove Texture on the screen
I drew 2D textures on the screen by using GUI.DrawTexture and GUI.Button.
I would like to remove those texture from the screen.
How can i do that? which API should i use?
void OnGUI() { GUI.skin = myGUI;
// draw a background image of main menu screen GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), mainMenuBG);
// make 3 buttons as a main menu
if (GUI.Button (new Rect (Screen.width / 2 - 128 / 2, Screen.height / 2 + 32, 128, 32), newGame, "NewGame"))
{
Debug.Log("Start New Game");
Application.LoadLevel(2); // Level2 : Stage1
}
} // end of OnGUI class
Comment
Answer by DaveA · Apr 29, 2011 at 09:44 PM
You simply don't call it:
if (iWantToSeeIt)
// draw a background image of main menu screen
GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), mainMenuBG);
Your answer
Follow this Question
Related Questions
Creating Buttons that change an int Value 2 Answers
Change GUI.Button Texture on runtime 1 Answer
gui.button not display text and texture 2 Answers