hyper space
This commit is contained in:
11
ui/ui.gd
Normal file
11
ui/ui.gd
Normal file
@ -0,0 +1,11 @@
|
||||
extends MarginContainer
|
||||
|
||||
@onready var shield_bar = $HBoxContainer/ShieldBar
|
||||
@onready var score_counter = $HBoxContainer/ScoreCounter
|
||||
|
||||
func update_score(value):
|
||||
score_counter.display_digits(value)
|
||||
|
||||
func update_shield(max_value, value):
|
||||
shield_bar.max_value = max_value
|
||||
shield_bar.value = value
|
37
ui/ui.tscn
Normal file
37
ui/ui.tscn
Normal file
@ -0,0 +1,37 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://c78q4a2j7gjow"]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/ui.gd" id="1_nfyhk"]
|
||||
[ext_resource type="Texture2D" uid="uid://bufp3nx5nbfac" path="res://assets/UI objects/bar_background.png" id="1_p1vxi"]
|
||||
[ext_resource type="Texture2D" uid="uid://cl57s76eyq8e6" path="res://assets/UI objects/bar_foreground.png" id="2_ioryv"]
|
||||
[ext_resource type="PackedScene" uid="uid://csdfxrgu1qmd5" path="res://score_counter/score_counter.tscn" id="4_wngna"]
|
||||
|
||||
[node name="UI" type="MarginContainer"]
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
script = ExtResource("1_nfyhk")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ShieldBar" type="TextureProgressBar" parent="HBoxContainer"]
|
||||
custom_minimum_size = Vector2(80, 16)
|
||||
layout_mode = 2
|
||||
value = 100.0
|
||||
nine_patch_stretch = true
|
||||
stretch_margin_left = 3
|
||||
stretch_margin_top = 3
|
||||
stretch_margin_right = 3
|
||||
stretch_margin_bottom = 3
|
||||
texture_under = ExtResource("1_p1vxi")
|
||||
texture_progress = ExtResource("2_ioryv")
|
||||
|
||||
[node name="ScoreCounter" parent="HBoxContainer" instance=ExtResource("4_wngna")]
|
||||
layout_mode = 2
|
Reference in New Issue
Block a user