enemies_ui script
parent
ee0fba050d
commit
410fa11acf
@ -1,22 +1,27 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bv0yhkf3bvbxi"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bv0yhkf3bvbxi"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://brdoqvapyya5b" path="res://resources/images/icon.svg" id="1_rvge7"]
|
||||
[ext_resource type="Texture2D" uid="uid://chkly72g0pu8o" path="res://resources/images/viking-helmet.png" id="1_7x375"]
|
||||
[ext_resource type="Script" path="res://scripts/enemies_ui.gd" id="1_atxm0"]
|
||||
|
||||
[node name="Enemies_UI" type="Control"]
|
||||
custom_minimum_size = Vector2(64, 128)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource("1_atxm0")
|
||||
|
||||
[node name="CanvasGroup" type="CanvasGroup" parent="."]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="CanvasGroup"]
|
||||
position = Vector2(64, 64)
|
||||
texture = ExtResource("1_rvge7")
|
||||
position = Vector2(32, 32)
|
||||
scale = Vector2(0.125, 0.125)
|
||||
texture = ExtResource("1_7x375")
|
||||
|
||||
[node name="Label" type="Label" parent="CanvasGroup"]
|
||||
offset_top = 128.0
|
||||
offset_right = 128.0
|
||||
offset_bottom = 151.0
|
||||
text = "Name: Godot
|
||||
Position: 0, 0, 0"
|
||||
offset_top = 64.0
|
||||
offset_right = 64.0
|
||||
offset_bottom = 113.0
|
||||
text = "Godot
|
||||
0, 0, 0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://chkly72g0pu8o"
|
||||
path="res://.godot/imported/viking-helmet.png-24c3ab0eccac4d3c5741deae96d6c1e0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/images/viking-helmet.png"
|
||||
dest_files=["res://.godot/imported/viking-helmet.png-24c3ab0eccac4d3c5741deae96d6c1e0.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,12 @@
|
||||
class_name EnemiesUI extends Control
|
||||
|
||||
@export var spawn_manager: SpawnManager
|
||||
|
||||
@onready var sprite_2d: Sprite2D = $CanvasGroup/Sprite2D
|
||||
@onready var label: Label = $CanvasGroup/Label
|
||||
|
||||
func _ready() -> void:
|
||||
spawn_manager.update_enemies_ui.connect(update_enemy_ui)
|
||||
|
||||
func update_enemy_ui(enemy: Enemy) -> void:
|
||||
label.text = enemy.unit_name + "\n" + str(enemy.position)
|
||||
Loading…
Reference in New Issue