- Home /
How to make a pause menu with Gui Texture??
Hi Can someone say me How to make a pause menu with Gui Texture?? Sry i have no idea why to make it?? Not a gui button only a gui texture when i press my pause button than the gui texture come and when i not press my pause button the gui texture is visible.
Answer by fafase · Mar 09, 2014 at 05:22 PM
You can enable/disable GUITexture so that they show/disappear when the pause is activated.
You could use an event to which a method subscribe and set all the GUITexture for the pause and inverse.
Or you use GetComponent.
Then you can use:
if(guiTexture.enabled == true && Input.GetMouseButtonDown(0) &&
guiTexture.HitTest(Input.mousePosition))
{
// Action
}
This above is same as
if(GUI.Button(rect, text)){}
but it would run in some Update.
But when i use like this one and push my pause button nothing happend and when i resume the gui come ??
if(guiPause.enabled == true && Input.Get$$anonymous$$ouseButtonDown(0) &&
guiPause.HitTest(Input.mousePosition))
{
guiPause$$anonymous$$enu.enabled = true;
guiPause.enabled = false;
}
Answer by haim96 · Mar 09, 2014 at 02:16 PM
check if this helpful in some way for you:
Thx but this is not using gui texture i want my button are locks better not the normal gui button. And when i used this https://www.assetstore.unity3d.com/#/content/1020 and add this my game and start this in my galaxy s3 i dont see the pause menu?? Only when i played with pc or use remote with my galaxy s3.
converted you answer to comment. any way, you have a problem with the look of the menu?
here a reference to how to use gui texture: http://docs.unity3d.com/Documentation/Components/class-GuiTexture.html
and the scripting part: http://docs.unity3d.com/Documentation/ScriptReference/GUITexture.html