Search Unity

GUI Menu help

Discussion in 'Immediate Mode GUI (IMGUI)' started by ddulshan, Sep 28, 2014.

  1. ddulshan

    ddulshan

    Joined:
    Mar 16, 2014
    Posts:
    190
    Hi, so I'm trying to make a Menu in my game. The scence is all set up. So, now I need to know how to make the menu. I'm not much familiar with GUI. So I need to know the easiest and effective way to do this. I need to include these buttons.

    1. Start Game > New Game, Continue Game, Load Game.
    2. Options > Controls, Graphics, Sounds.
    3. Exit Game

    I need to know how to do this and I'd realy appriciate if you could show me a script example. Thanks!
     
  2. ddulshan

    ddulshan

    Joined:
    Mar 16, 2014
    Posts:
    190
    Edit: I prefer Java, if there any scriptings to do.
     
  3. ddulshan

    ddulshan

    Joined:
    Mar 16, 2014
    Posts:
    190
    Come on guys! I'm just a newbie around GUI. :D
     
  4. ddulshan

    ddulshan

    Joined:
    Mar 16, 2014
    Posts:
    190
    Eh, hello?
     
  5. ddulshan

    ddulshan

    Joined:
    Mar 16, 2014
    Posts:
    190
    Come on guys! Please!....
     
  6. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
  7. ddulshan

    ddulshan

    Joined:
    Mar 16, 2014
    Posts:
    190
    Well one more thing, I cant watch Video tuts. Connection sucks!
     
  8. AlexanderXane

    AlexanderXane

    Joined:
    Oct 5, 2014
    Posts:
    4
    To make a main menu.... hmmmm... you'll have to get familiar with GUI.... here's a script i made for my main menu... am still learning alot on unity though. Am not working on my main menu yet so this isnt really perfect... but alter a few values in the script to see/try and get a little understanding

    var exitTexture : Texture2D;
    var level1 = 0;
    var level2 = 0;
    var level3 = 0;
    var level4 = 0;
    var level5 = 0;
    var level6 = 0;

    function OnGUI (){

    if(GUI.Button(Rect(30,20,30,30), exitTexture))
    {
    Application.Quit();
    }
    GUI.color = Color.red;
    GUI.Box(Rect(1000,40,300,530), "");
    GUI.contentColor = Color.black;
    GUI.color = Color.blue;
    GUI.skin.font = font;
    if(GUI.Button(Rect(1025,200,250,50), "Level 1"))
    {
    Application.LoadLevel(level1);
    }
    if(GUI.Button(Rect(1025,260,250,50), "Level 2"))
    {
    Application.LoadLevel(level2);
    }
    if(GUI.Button(Rect(1025,320,250,50), "Level 3"))
    {
    Application.LoadLevel(level3);
    }
    if(GUI.Button(Rect(1025,380,250,50), "Level 4"))
    {
    Application.LoadLevel(level4);
    }
    if(GUI.Button(Rect(1025,440,250,50), "Level 5"))
    {
    Application.LoadLevel(level5);
    }
    if(GUI.Button(Rect(1025,500,250,50), "Level 6"))
    {
    Application.LoadLevel(level6);
    }
    }
     
  9. iSmart

    iSmart

    Joined:
    Sep 23, 2014
    Posts:
    43
    Well, so to make a main menu i should use Unity GUI API or using Unity 4.6 UI new system? which one will be better for hotting mobile designs?
     
  10. ddulshan

    ddulshan

    Joined:
    Mar 16, 2014
    Posts:
    190
    So you mean the easiest way is scripting?