Some nice rounding in float representation
This commit is contained in:
parent
1982eb5e4e
commit
997e3c0982
6 changed files with 33 additions and 9 deletions
|
|
@ -19,7 +19,12 @@ script/source = "extends Label
|
|||
@onready var ship: Ship = get_parent().get_parent().get_parent()
|
||||
|
||||
func _process(_delta):
|
||||
text = unformatted_text.format([ship.hull.hp, ship.hull.max_hp, ship.shield.capacity, ship.shield.max_capacity])
|
||||
text = unformatted_text.format([
|
||||
round(ship.hull.hp * 100) / 100.0,
|
||||
ship.hull.max_hp,
|
||||
round(ship.shield.capacity * 100) / 100.0,
|
||||
ship.shield.max_capacity
|
||||
])
|
||||
"
|
||||
|
||||
[node name="KamikazeShip" type="Node2D"]
|
||||
|
|
|
|||
|
|
@ -20,7 +20,12 @@ script/source = "extends Label
|
|||
@onready var ship: Ship = get_parent().get_parent().get_parent()
|
||||
|
||||
func _process(_delta):
|
||||
text = unformatted_text.format([ship.hull.hp, ship.hull.max_hp, ship.shield.capacity, ship.shield.max_capacity])
|
||||
text = unformatted_text.format([
|
||||
round(ship.hull.hp * 100) / 100.0,
|
||||
ship.hull.max_hp,
|
||||
round(ship.shield.capacity * 100) / 100.0,
|
||||
ship.shield.max_capacity
|
||||
])
|
||||
"
|
||||
|
||||
[node name="ShooterShip" type="Node2D"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue