Total Miner Forums

Total Miner => Creative Features => Topic started by: Lunar on March 18, 2017, 11:00:27 PM

Title: HUD Menu!
Post by: Lunar 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.

Title: Re: HUD Menu!
Post by: assasin steve12 on July 21, 2017, 01:07:47 PM
For option 1 and option 2 do i put that in the script or fill that out?
Title: Re: HUD Menu!
Post by: Lunar on July 23, 2017, 05:59:04 PM
I dont understand the question, could you go into more depth?
Title: Re: HUD Menu!
Post by: Gary on July 23, 2017, 06:43:40 PM
I dont understand the question, could you go into more depth?

For option 1 and option 2 do i put that in the script or fill that out?

HUDText [option1] [option 1]
HUDText [option2] [option 2]
Title: Re: HUD Menu!
Post by: NaeZo, the MLG on July 25, 2017, 11:52:59 AM
I already have done this in one of my project I can't finish... And I added a scrolling menu animation when i press X
Title: Re: HUD Menu!
Post by: Lunar on July 26, 2017, 03:31:34 AM
Do you need me to join your world and help? This is a very very basic framework of the actual menu, you would need further scripting knowledge and an understanding of the script to truly finish it.