Author Topic: [Scripts] HUD Menu!  (Read 100 times)

0 Members and 1 Guest are viewing this topic.

Lunar

  • Elite Member
  • *****
  • Posts: 878
  • The God of the Galaxy
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: Qvzw
  • PSN: Widumn_Boise
[Scripts] HUD Menu!
« on: March 18, 2017, 11:00:27 PM »
This was nested in a question someone wanted wondering how to create my HUD Menu I have created, I decided to make a post dedicated to it, if you want any animation/customization help PM me, here is how it all works...



Script: Menu



HUDText [option1] [option 1]
HUDText [option2] [option 2]
SetEventScript [ButtonX] [Scroll]
SetEventScript [ButtonY] [Select]
SetEventScript [ButtonB] [Close]




Script: Scroll



If
HasHistory [scroll] [player] [=] [0]
Then
History [scroll] [player] [+1]
HUDText [option2] [option 2] //reverts the option 2 back to normal so 2 arrows dont show
HUDText [option1] [option 1 <<<] //gives an arrow so they know which one they are about to select
ElseIf
HasHistory [scroll] [player] [=] [1]
Then
History [scroll] [player] [delete]
HUDText [option1] [option 1]
HUDText [option2] [option 2 <<<]
Else
EndIf




Script: Select



If
HasHistory [scroll] [player] [1]
//if they are hovering over the first option, its 1 history, 2nd is 2, 3rd is 3, and the last option is 0 (none)
Then
//do whatever option 1 does
History [scroll] [player] [delete]
SetEventScript [ButtonX] [] [none]
SetEventScript [ButtonY] [] [none]
SetEventScript [ButtonB] [Back] [Back]
ElseIf
HasHistory [scroll] [player] [0]
Then
//do whatever option 2 does
History [scroll] [player] [delete]
SetEventScript [ButtonX] [] [none]
SetEventScript [ButtonY] [] [none]
SetEventScript [ButtonB] [Back]
Else
EndIf




Script: Back



HUDText [option1] [option 1]
HUDText [option2] [option 2]
SetEventScript [ButtonX] [Scroll]
SetEventScript [ButtonY] [Select]
SetEventScript [ButtonB] [Close]
History [scroll] [player] [delete]




Now, that is just the basic framework for it, there is still more things you could do, make one menu option open a lot of different options, which then you would have to make a second Scroll and Select script so they can work with the second set of options, you could add animations, and a background for the menu.