Interface HealthBarUpdate


public interface HealthBarUpdate
Represents an update to a health bar's displayed value.

Health bar updates track changes to an actor's health over time. Each update contains a health ratio value that indicates the actor's current health as a proportion of the health bar's scale.

To calculate the actual health percentage, divide the health ratio by the scale value from the associated HealthBarConfig.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the health ratio for this update.
  • Method Details

    • getHealthRatio

      int getHealthRatio()
      Gets the health ratio for this update.

      The health ratio represents the actor's current health as a value relative to the health bar's scale. To calculate the percentage: (healthRatio / scale) * 100.

      For example, if the scale is 30 and this method returns 15, the actor is at 50% health.

      Returns:
      the health ratio value for this update
      See Also: