Hello, I'd like to make a visual HP Bar on the HUD that visually updates to reflect HP depletion. To make it even easier, the bar is split into 10 'chunks' between empty and full, and the Combatants HP will be an even 100. Every loss of 10 HP knocks a segment off. I've gotten a few helpful tips on how to do this on the Discord, but this seems like one of those things that could be done in a variety of ways, and I'm looking for the easiest/simplest/cleanest way to do this within Ork's framework.
I've looked around and the below link seems to touch on it, but I'm not sure quite how to do it. Below is an example of how this HUD will look (full HP example below) and how the bar will update itself as HP goes up and down.
https://orkframework.com/guide/documentation/ui-system/huds-value-bar-content/
This uses prefabs (with regular HUD Value Bar setup, e.g. using sprites) to display defined chunks of the displayed value, e.g. each icon/prefab displaying a value of 10, or 4, etc.
You can set up pre-placed icons for your layout, or use one of the layout components to handle the layout of the created prefab icons.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
https://imgur.com/a/R308uNe
So, remove the ORK HUD Icon Bar Content component from the game object, make a prefab out of the Value Bar (Sprite) child object, remove it from the HUD and add the ORK HUD Icon Bar Content e.g. to the Health HUD child object and use the prefab from the value bar in it. The icon bar will create prefab instances as needed for the value.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
My Max HP is 10, and I'm basically telling the HUD Icon Bar Content (in the 'Health HUD prefab), is to utilize the Value Bar prefab to adjust the sprite its displaying based on the information its getting from the HUD Status Value Content Provider (in the 'Health HUD prefab), set up to pull from the Health Points Status Value.
The way its set up now, is that it duplicates the Value Bar prefab 10 times (because my HP is 10).
https://imgur.com/a/cxSSaJX
What I want it to to is to change that health bar sprite to another health sprite (each sprite representing how much health is remaining, example above) depending on the HP percentage remaining. Basically, how this would look is a segmented health bar like this;
https://art.pixilart.com/75f1025507a19ca.gif
https://i.imgur.com/y3LqfSh.png
The Health Bar is divided into 10 segmented, and each 10% lost/gained changes the sprite into the appropriately segmented one.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!