In this recipe, we will add a stamina display to an interface for use with the sprint system previously implemented in Recipe #5 – Sprint with Stamina (Using Statistics).
https://steamcommunity.com/sharedfiles/filedetails/?id=2383632299
https://steamcommunity.com/sharedfiles/filedetails/?id=2383632299
Requirements
- A stamina system, as previously described in Recipe #5.
- An interface for your HUD elements.
- (Optional) An icon for your Sprint statistic.
Setup
- After opening your project, select Interfaces in the lower left to list your interfaces.
- Open your HUD interface.
- Using the Graph tool, add a field to the interface. Don’t worry about where you place it, you can adjust it later.
- In the field’s Use Value settings, click on the box beside Retrieve Value.
- Select Current Statistic under the Actor category.
- Select (Main) for Actor and Stamina for Statistic.
- Click OK to close the window.
- Select Current Statistic under the Actor category.
- Also in the field’s Use Value settings, click on the box beside Retrieve Maximum.
- Select Maximum Statistic under the Actor category.
- Select (Main) for Actor and Stamina for Statistic.
- Click OK to close the window.
- Select Maximum Statistic under the Actor category.
- Style the field however you like.
- TheShape option under Behavior allows you to switch your field between Pie, Bar, and Rotating Dial modes. Bar probably makes the most sense for this field, but you can use whichever you prefer.
- Click OK to close the window. You can move and resize the field with the Pointer tool in the interface editor.
- In the field’s Use Value settings, click on the box beside Retrieve Value.
- If you have added an icon to your statistic:
- Using the Field tool, add a text field somewhere near your graph.
- Click on the use value box next to Retrieve Text under the Use Values section.
- Select Graphic under the Statisticcategory.
- Select Stamina for Statistic.
- Click OKto close the window.
- Select Graphic under the Statisticcategory.
- Click OK to close the field window.
- Click on the use value box next to Retrieve Text under the Use Values section.
- This text field will now display the graphic that you previously assigned to the Stamina statistic. If there is no graphic assigned to that statistic, it will display a white square instead.
- Using the Field tool, add a text field somewhere near your graph.
- Using the Graph tool, add a field to the interface. Don’t worry about where you place it, you can adjust it later.
- Test out your new interface!
Notes
If you’re using a template, your game probably already has a default HUD interface. If you’re not (or you’ve created your own interface), you can add one by selecting it in the Default HUD list under Interfaces in the Game Settings window.
Written by MrNumbers
Hope you enjoy the post for 001 Game Creator Game Recipe #6 – Stamina HUD, If you think we should update the post or something is wrong please let us know via comment and we will fix it how fast as possible! Thank you and have a great day!
Recommended for You:
- Check All 001 Game Creator Posts List
Leave a Reply