Setup UI canvas, added shield and game start.

This commit is contained in:
Henry 2025-12-09 12:00:26 +00:00
parent e582ed7ec3
commit ef773a1ec5
11 changed files with 223 additions and 17 deletions

View file

@ -1,8 +1,25 @@
[gd_scene load_steps=7 format=3 uid="uid://cc2dnhuv4qx7m"]
[gd_scene load_steps=9 format=3 uid="uid://cc2dnhuv4qx7m"]
[ext_resource type="Script" uid="uid://c51huloycn5as" path="res://main.gd" id="1_h2yge"]
[ext_resource type="Texture2D" uid="uid://jj8b7vqj3ihx" path="res://Mini Pixel Pack 3/Space_BG (2 frames) (64 x 64).png" id="1_ig7tw"]
[ext_resource type="PackedScene" uid="uid://pyuorpwb7lpe" path="res://player.tscn" id="2_0xm2m"]
[ext_resource type="PackedScene" uid="uid://s6wf3egdqtmh" path="res://ui.tscn" id="4_1bvp3"]
[ext_resource type="Texture2D" uid="uid://bonoqs5pisflo" path="res://Mini Pixel Pack 3/UI objects/START (48 x 8).png" id="5_lquwl"]
[sub_resource type="Animation" id="Animation_1bvp3"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("background:region_rect")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Rect2(0, 0, 240, 320)]
}
[sub_resource type="Animation" id="Animation_h2yge"]
resource_name = "scroll"
@ -21,21 +38,6 @@ tracks/0/keys = {
"values": [Rect2(0, 0, 240, 320), Rect2(0, -64, 240, 320)]
}
[sub_resource type="Animation" id="Animation_1bvp3"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("background:region_rect")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Rect2(0, 0, 240, 320)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_lquwl"]
_data = {
&"RESET": SubResource("Animation_1bvp3"),
@ -60,3 +62,21 @@ libraries = {
&"": SubResource("AnimationLibrary_lquwl")
}
autoplay = "scroll"
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="UI" parent="CanvasLayer" instance=ExtResource("4_1bvp3")]
[node name="CenterContainer" type="CenterContainer" parent="CanvasLayer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Start" type="TextureButton" parent="CanvasLayer/CenterContainer"]
layout_mode = 2
texture_normal = ExtResource("5_lquwl")
[connection signal="shield_changed" from="Player" to="CanvasLayer/UI" method="update_shield"]
[connection signal="pressed" from="CanvasLayer/CenterContainer/Start" to="." method="_on_start_pressed"]