This library offers different tools to customize the health bar look and behaviour. First, let's divide the available tools according to their task:
- Rendering methods : placed in the HealthBar class, they take care of the rendering itself.
- Manipulation methods : these methods, stored in the HealthComponent class, provide access to textures and behaviors.
- Creation methods : these methods can be found in the HealthTypes class and allow the creation of new HeartTypes (containers with all the different states a heart can take, such as full, half, blinking, etc...).
Dikkat et!
There is another class not mentioned: the HealthBarVariables class, witch contains all the variables the library uses. This class should never be accessed directly, since all the variables can be overridden through the methods inside the HealthComponent class.
Finally, let's talk about the last 2 classes not mentioned. The CustomContainerType and the CustomHeartType. This two classes are responsible for the creation of two different heart types: the containers amd the hearts. These two are different from the vanilla HeartType, since the HeartType enum cannot be accessed or overridden. This library then creates two new heart types (CustomContainerType, CustomHeartType) that get used in all the methods this library use.
Why creating two different heart types and not one?
The creator (me!) decided to create two separate heart type to allow developers to easily organise their project, and to make it harder to mistakenly using the wrong elements. This way, the methods responsible for overriding the heart container texture only accept the CustomContainerType, while the ones responsible for the hearts textures only accept the CustomHeartType.
-> Check out the guide on rendering methods first!