Adding Health Bar and Stamina Bar
Add a new CanvasLayer node as a child of Player
Add a new ColorRect node as a child of UI
Rename the ColorRect to HealthBar
Add another ColorRect as a child of HealthBar
Select the HealthBar node
Set the color to dark grey
The exact hex code is: 3a39356a
Set the Anchors Preset to Bottom Left
Set the position to 5, 155
Select the Value label node
The exact hex code is: a4de79
Set the Anchors Preset to Center
Set the position to 1 , 1
Select the HealthBar node
Attach a new script to it
Create a ready variable to reference the value node
Create a function to update the the health bar
It receives two parameters
health which is the current health
max_health which is the maximum value
finally fill the value bar with green color
based on the percentage health available
98 is the full width of the bar
health / max_health gives a number between 0 and 1
So if health is 50 and max_health is 100
98 * (50/100) = 98 * 0.5 = 49
The bar will be 49 pixels of green
Duplicate the HealthBar node
To move it below the HealthBar
The exact Hex value is: 377c9e
Set the Anchors Preset to Center
Set the position to 1 , 1
Select the StaminaBar node
Attach a new script to it
Create a ready variable to reference the value node
Create a function to update the the stamina bar
It receives two parameters
stamina which is the current stamina
max_stamina which is the maximum value
finally fill the value bar with blue color
based on the percentage stamina available
98 is the full width of the bar
stamina / max_stamina gives a number between 0 and 1
So if stamina is 50 and max_stamina is 100
98 * (50/100) = 98 * 0.5 = 49
The bar will be 49 pixels of blue
Add another ColorRect as a child
Add a Sprite2D as a child
Select the AmmoAmount node
To create a transparent grey box
Set the color value to 3a39356a
Set the size to x: 40, y: 20
Set the position to x: 5, y: 8
For the texture navigate to
assets --> Icons --> shard_01i.png
Set the Icon position to x: 10, y: 10
Set the text property to 0
Set horizontal and vertical alignment to center
Set the anchor to center right
Set position to x: 21, y: -3
Change the font by choosing Theme Overrides
Set the Font Size to 20px
Duplicate the AmmoAmount Node
Rename the first duplicate to
Set the position of HealthAmount to x: 50, y: 8
Set the position of StaminaAmount to x: 95, y: 8
Change the HealthAmount Icon to potion_02c.png
Change the StaminaAmountIcon to potion_02b.png
Add two Labels as Children
Rename the second Label Value
Set the XP node color to 3a39356a
Set the size and position as shown
Change the font of both labels
Change the Text of the Label to
Change the Text of Value to
Change the anchor of the Label
Set Horizontal alignment to Right
Set Vertical alignment to Center
Change the anchor of the Value label
Change the Level position
Change the Text of Label to
Change the Text of the Value to
The final game GUI is now shown