-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathHUD.gd
More file actions
32 lines (26 loc) · 657 Bytes
/
HUD.gd
File metadata and controls
32 lines (26 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
extends CanvasLayer
func _input(event):
pass
# pause code
func update_score(val):
$ScoreLabel.text = str(val)
func update_cash(val):
$CashLabel.text = str(val)
func update_shield(val):
if val <= 0:
$ShieldIcon.modulate = Color(1, 1, 1, 0.5)
var color = 'green'
if val < 40:
color = 'red'
elif val < 70:
color = 'yellow'
var texture = load("res://art/gui/barHorizontal_%s_mid 200.png" % color)
$ShieldBar.texture_progress = texture
$ShieldBar.value = val
func show_message(text):
$MessageLabel.text = text
$MessageLabel.show()
$MessageTimer.start()
func _on_MessageTimer_timeout():
$MessageLabel.hide()
$MessageLabel.text = ''