HealthMeter

Manage and draw the health meter

Author
  • Mark Mayes / mm-dev
License
  • GPL-3.0-only

Methods

(static) draw()

Source
Call other functions to update and draw the meter

(static) drawBackground()

Source
The translucent padded background

(static) drawHeart()

Source
The heart icon

(static) drawInnerBar()

Source
The inner bar

This is the part that changes in size (shrinks) as the player's health diminishes.

(static) drawOuterStroke()

Source
The main outline

(static) setStrokeProperties()

Source
Set the thickness and colour of the stroke for drawing the outline and cap line

(static) updateSizes()

Source
Update the dimensions of the meter

Size is based on text character widths or heights (depending on viewport aspect ratio), so that the meter lines up with the (conceptual) text grid.