Search Unity

Final Fantasy like menu

Discussion in 'Scripting' started by DarkBladeNemo, Oct 6, 2015.

  1. DarkBladeNemo

    DarkBladeNemo

    Joined:
    Aug 23, 2013
    Posts:
    116
    Evening guys,

    So tonight I wanted to try out a bit of GUI stuff and kinda failed horribly at what I was attempting.
    I'm trying to replicate a similar menu system that Final Fantasy and well every other console game uses.

    Instead of moving the mouse to the button and click it you would simply just scroll through it with up and down etc.

    Now I started off by doing the following:

    Code (CSharp):
    1. void OnGUI(){
    2.         GUI.Box(new Rect(0, 420, Screen.width, Screen.height / 3.5f), "Command");
    3.         GUI.Button(new Rect(80, 425, 100, 20), "Attack");
    4.         GUI.Button(new Rect(80, 450, 100, 20), "Skills");
    5.         GUI.Button(new Rect(80, 475, 100, 20), "Items");
    6.     }
    7.  
    Then... I got lost and had no idea what I was doing or where to start :/

    I was thinking if doing the following though my scripting is still after many years on the forum very sketchy AKA I havent been practicing.

    Code (CSharp):
    1. public string battleOptions = new string [4]
    2. battleOptions[0] = "Attack";
    3. battleOptions[1] = "Skills";
    4. battleOptions[2] = "Items";
    5. battleOptions[3] =  "Run";
    6.  
    Then I think using Methods to move from Attack to Skills or Run depending on the direction pushed but have no idea how to go about doing it. But like I said my scripting is horrible and chances are there is some Java in here.... somewhere :/

    Any help would be awesome and appreciated.
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    Kiwasi likes this.
  3. DarkBladeNemo

    DarkBladeNemo

    Joined:
    Aug 23, 2013
    Posts:
    116
    Ohhh thank you something fun to play with :D Well now I just need to figure out how to do what I want.

    Any advice?
     
  4. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    scrollable menus probably means you'll end up using scroll rects. If you aren't going to be interacting with them directly you'll need to set them as "non intractable" and change their display position via script (i.e. mouse scrollwheel gets picked up and changes the scrollrect's display position), there's an entire live training session on scripting scroll rects to hold variable contents on that learn page.
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    This may be applicable? I'm not sure exactly what you want, I've never played the Final Fantasy games myself.