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): void OnGUI(){ GUI.Box(new Rect(0, 420, Screen.width, Screen.height / 3.5f), "Command"); GUI.Button(new Rect(80, 425, 100, 20), "Attack"); GUI.Button(new Rect(80, 450, 100, 20), "Skills"); GUI.Button(new Rect(80, 475, 100, 20), "Items"); } 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): public string battleOptions = new string [4] battleOptions[0] = "Attack"; battleOptions[1] = "Skills"; battleOptions[2] = "Items"; battleOptions[3] = "Run"; 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.
if you are just starting out with UIs I'd highly recommend working with the new UI system and not use the old legacy system... https://unity3d.com/learn/tutorials/topics/user-interface-ui
Ohhh thank you something fun to play with Well now I just need to figure out how to do what I want. Any advice?
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.
This may be applicable? I'm not sure exactly what you want, I've never played the Final Fantasy games myself.