Missiles limit & UI

This commit is contained in:
Felipe M 2021-05-18 20:43:07 +02:00
parent 853eb28d33
commit 632d927938
Signed by: fmartingr
GPG key ID: 716BC147715E716F
5 changed files with 55 additions and 2 deletions

View file

@ -0,0 +1,11 @@
extends HBoxContainer
var PlayerStats = ResourceLoader.PlayerStats
onready var label = $Label
func _ready():
PlayerStats.connect("player_missiles_changed", self, "_on_player_missiles_changed")
func _on_player_missiles_changed(value):
label.text = str(value)

View file

@ -0,0 +1,27 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Assets/UI/PlayerMissileIcon.png" type="Texture" id=1]
[ext_resource path="res://Scenes/UI/PixelFont.tres" type="DynamicFont" id=2]
[ext_resource path="res://Scenes/UI/MissilesUI.gd" type="Script" id=3]
[node name="MissilesUI" type="HBoxContainer"]
margin_right = 33.0
margin_bottom = 12.0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Icon" type="TextureRect" parent="."]
margin_right = 8.0
margin_bottom = 12.0
texture = ExtResource( 1 )
[node name="Label" type="Label" parent="."]
margin_left = 12.0
margin_right = 17.0
margin_bottom = 7.0
size_flags_horizontal = 2
size_flags_vertical = 2
custom_fonts/font = ExtResource( 2 )
text = "3"

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Scenes/UI/HealthMeter.tscn" type="PackedScene" id=1]
[ext_resource path="res://Scenes/Menus/PauseMenu.tscn" type="PackedScene" id=2]
[ext_resource path="res://Scenes/UI/MissilesUI.tscn" type="PackedScene" id=3]
[node name="UI" type="CanvasLayer"]
@ -13,3 +14,9 @@ margin_bottom = 16.0
[node name="PauseMenu" parent="." instance=ExtResource( 2 )]
visible = false
[node name="MissilesUI" parent="." instance=ExtResource( 3 )]
margin_left = 4.0
margin_top = 19.0
margin_right = 37.0
margin_bottom = 31.0