Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Rayleigh2116 · Mar 03, 2014 at 01:50 AM · guimenupause

How to make a 2d gui that can go down??

Hi I want a simple 2gui text for example i hit a pause button than the pause come down from upstairs because i dont want to make a new scene. Hope you anderstand this sorry bad english. I make a screen shot from a other game !

http://answers.unity3d.com/storage/temp/22988-pause%201.png

pause 1.png (93.0 kB)
2pause.png (24.2 kB)
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Mar 03, 2014 at 01:52 AM 0
Share

Things like this are fairly easy to do in third-party GUI systems line NGUI and EZGUI. Rumor has it that Unity will soon have a new GUI system based on NGUI. But doing this with existing GUI stuff in Unity can be difficult (I$$anonymous$$HO). You can build it out of scene displayed to a second camera (which is what EZGUI and NGUI do), or perhaps you can get want you want using GUITexture objects.

avatar image Rayleigh2116 · Mar 03, 2014 at 04:30 PM 0
Share

how can i make with NGUI and EZGUI a gui that come down??

avatar image robertbu · Mar 03, 2014 at 07:52 PM 0
Share

I can only speak to EZGUI. On the parent object of your controls built with EZGUI, you can attach a Bi-State Interactive Panel script. Take a look at the EZGUI showcase video to get an idea of what you can do:

http://www.anbsoft.com/middleware/ezgui/ez_gui_showcase/index.html

You will see some menu's sliding in starting around the 1:00 mark.

But considering that NGUI-like functionality will soon be part of Unity, NGUI would likely be the better way to go.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by karenkrane · Mar 03, 2014 at 07:04 PM

I'm not sure what you mean by "go down"... move down the screen? You would just put hte code in a separate function:

 using UnityEngine;
 using System.Collections;
 
 public class Pause : MonoBehaviour {
     
     public bool isPaused= false;
     GUIStyle pauseStyle;
     Texture pausePopUp;
     
     void  OnGUI (){
         
         
         
         if (GUI.Button ( new Rect(50, 50, 150,65), " ", pauseStyle))
         {
             
             Time.timeScale = 0;
             isPaused = true;
             
         }
         
         
         
         if(isPaused)
         {
             //show the popup pause menu or new location of the existing pause button here...
             if(GUI.Button( new Rect(10, 10, 700,700), pausePopUp))
             {
             //click the new button to turn off pause
                 isPaused = false;
             }
             
         }
     }
 }
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Rayleigh2116 · Mar 03, 2014 at 09:54 PM 0
Share

yes but i want not draw a gui Label or button i want a picture like a menu that come from upstairs and come down. like venetians.

Edit: so now i find another way how can i make this one but ein problem is there i want this when i pushh the gui texture but how can i do this?? using UnityEngine; using System.Collections;

 public class gui : $$anonymous$$onoBehaviour {
 
 
     
     public GameObject[] pauseElements;          //The pause menu elements
     bool showPause            = false;            //The pause showed
     bool canClick            = true;                //The player can click
 
 
 
 
 
     void Update()
     {
                 if (Input.Get$$anonymous$$eyDown ($$anonymous$$eyCode.P)) {
 
                     
                         //Show the pause GUI element
                         StartCoroutine ($$anonymous$$ove$$anonymous$$enu (pauseElements [1].transform, 0, 3, 0.45f, false));
                             }
 
         if (Input.Get$$anonymous$$eyDown ($$anonymous$$eyCode.A)){
 
             
             //Show the pause GUI element
             StartCoroutine ($$anonymous$$ove$$anonymous$$enu (pauseElements [0].transform, 0, 6, 0.45f, false));
 
                 }
         }
 
 
 
 
 
     //$$anonymous$$oves a selected menu item to a specified space with speed
     IEnumerator $$anonymous$$ove$$anonymous$$enu(Transform menuTransform, float endPosX, float endPosY, float time, bool hide)
     {
         canClick = false;
         
         //$$anonymous$$ove the menu to the designated position under time
         float i = 0.0f;
         float rate = 1.0f / time;
         
         Vector3 startPos = menuTransform.localPosition;
         Vector3 endPos = new Vector3(endPosX, endPosY, menuTransform.localPosition.z);    
         
         while (i < 1.0) 
         {
             i += Time.deltaTime * rate;
             menuTransform.localPosition = Vector3.Lerp(startPos, endPos, i);
             yield return 0;
         }
 
 
     }
 
     
 }
 
 
 
 
 
 
     

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Halt function midway until player presses 'OK' then continue 1 Answer

GUI Buttons not working after scene transition 0 Answers

Paused Menu backdrop 1 Answer

How to pause a game with a GUI button 1 Answer

Pause Menu - Loading & Quitting 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges