New base menu template

This commit is contained in:
2ndbeam 2024-05-15 07:48:03 +03:00
commit f2cff37a22
12 changed files with 185 additions and 16 deletions

104
scenes/Base/base_menu.tscn Normal file
View file

@ -0,0 +1,104 @@
[gd_scene load_steps=5 format=3 uid="uid://crq284yed2if5"]
[ext_resource type="Script" path="res://scripts/Base/base_menu.gd" id="1_3hgu4"]
[ext_resource type="Texture2D" uid="uid://db4euprxhape0" path="res://sprites/9s.png" id="1_uf5rv"]
[ext_resource type="Texture2D" uid="uid://hxrx87gda3uf" path="res://sprites/Bases/Menu/end_communications.png" id="2_ceeiv"]
[ext_resource type="Script" path="res://scripts/Base/close_button.gd" id="4_68ool"]
[node name="BaseMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_3hgu4")
[node name="MenuBackground" type="NinePatchRect" parent="."]
layout_mode = 0
offset_left = 40.0
offset_top = 40.0
offset_right = 1240.0
offset_bottom = 640.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="HeaderBackground" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0
offset_left = 2.0
offset_top = 2.0
offset_right = 1198.0
offset_bottom = 76.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="PortraitBackground" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0
offset_left = 2.0
offset_top = 77.0
offset_right = 324.0
offset_bottom = 598.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="DialogueBackground" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0
offset_left = 325.0
offset_top = 77.0
offset_right = 1198.0
offset_bottom = 399.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="ActionsBackground" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0
offset_left = 325.0
offset_top = 400.0
offset_right = 1198.0
offset_bottom = 598.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="CloseButtonBackground" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0
offset_left = 1124.0
offset_top = 2.0
offset_right = 1198.0
offset_bottom = 76.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="CloseButton" type="Button" parent="MenuBackground/CloseButtonBackground"]
layout_mode = 0
offset_left = 1.0
offset_top = 1.0
offset_right = 73.0
offset_bottom = 73.0
icon = ExtResource("2_ceeiv")
script = ExtResource("4_68ool")
[connection signal="button_up" from="MenuBackground/CloseButtonBackground/CloseButton" to="MenuBackground/CloseButtonBackground/CloseButton" method="_on_button_up"]

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=5 format=3 uid="uid://dk3nvl8f0v24e"]
[gd_scene load_steps=6 format=3 uid="uid://dk3nvl8f0v24e"]
[ext_resource type="Script" path="res://scripts/Base/base.gd" id="1_dr4wr"]
[ext_resource type="Texture2D" uid="uid://3x77t3kd6v0x" path="res://sprites/Bases/triangle_base.png" id="1_nrkxw"]
[ext_resource type="PackedScene" uid="uid://crq284yed2if5" path="res://scenes/Base/base_menu.tscn" id="2_n6qqo"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4e5h0"]
size = Vector2(357, 4)
@ -15,6 +16,7 @@ collision_layer = 2
collision_mask = 7
input_pickable = true
script = ExtResource("1_dr4wr")
menu = ExtResource("2_n6qqo")
[node name="Sprite" type="Sprite2D" parent="."]
position = Vector2(0.5, 0.5)

View file

@ -4,6 +4,7 @@
[ext_resource type="Texture2D" uid="uid://bxtd2ij1dc1d3" path="res://sprites/Ships/shooter.png" id="2_gvwov"]
[node name="Hull" instance=ExtResource("1_7i1ve")]
collision_mask = 11
max_hp = 10.0
[node name="Sprite" parent="." index="0"]

View file

@ -26,7 +26,7 @@ position = Vector2(19, 10)
position = Vector2(1706, -5)
[node name="KamikazeShip" parent="FactionAggressive" index="0" instance=ExtResource("4_i6rbg")]
position = Vector2(-244, -914)
position = Vector2(-1712, -608)
[node name="ShooterShip" parent="FactionAggressive" index="1" instance=ExtResource("5_o3ny8")]
position = Vector2(-833, 1073)
position = Vector2(-1852, 618)

View file

@ -44,6 +44,7 @@ script = ExtResource("1_xx8w2")
pause_controller_scene = ExtResource("6_61vq5")
[node name="Stars" parent="." instance=ExtResource("2_iqrn0")]
stars_amount = 400
[node name="ProjectileContainer" type="Node" parent="."]
process_mode = 1