From c9755bfe8c35ebdc3dd00f287961c8675fac7dd0 Mon Sep 17 00:00:00 2001 From: PfandBoss <68470553+PfandBoss@users.noreply.github.com> Date: Sat, 10 Dec 2022 12:45:06 +0100 Subject: [PATCH] Game UI --- Nodes/game.tscn | 49 +++++++++++++++++++++++++++++-- scripts/Logic/Game.gd | 3 +- undefined - Imgur (1).png | Bin 0 -> 398 bytes undefined - Imgur (1).png.import | 34 +++++++++++++++++++++ undefined - Imgur.png | Bin 0 -> 401 bytes undefined - Imgur.png.import | 34 +++++++++++++++++++++ 6 files changed, 117 insertions(+), 3 deletions(-) create mode 100644 undefined - Imgur (1).png create mode 100644 undefined - Imgur (1).png.import create mode 100644 undefined - Imgur.png create mode 100644 undefined - Imgur.png.import diff --git a/Nodes/game.tscn b/Nodes/game.tscn index f8a0e42..2ef7cb3 100644 --- a/Nodes/game.tscn +++ b/Nodes/game.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=9 format=3 uid="uid://n7w0ff7u25yc"] +[gd_scene load_steps=15 format=3 uid="uid://n7w0ff7u25yc"] [ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_iox18"] [ext_resource type="PackedScene" uid="uid://bqe8ucbruto1j" path="res://Nodes/StartNode.tscn" id="2_61aog"] [ext_resource type="PackedScene" uid="uid://byo1m0n20yl45" path="res://Nodes/cannon.tscn" id="2_vrf6k"] [ext_resource type="Script" path="res://scripts/Train.gd" id="2_xl0he"] [ext_resource type="PackedScene" uid="uid://vwjd5od63jgh" path="res://Nodes/Player.tscn" id="4_1ipcp"] +[ext_resource type="Texture2D" uid="uid://b8rsm7uapp583" path="res://undefined - Imgur (1).png" id="6_agvbb"] +[ext_resource type="Texture2D" uid="uid://44lfs83sax35" path="res://undefined - Imgur.png" id="7_n8t7y"] [sub_resource type="BoxMesh" id="BoxMesh_ognqx"] size = Vector3(13, 1, 25) @@ -15,6 +17,14 @@ data = PackedVector3Array(-6.5, 0.5, 12.5, 6.5, 0.5, 12.5, -6.5, -0.5, 12.5, 6.5 [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_l76gd"] data = PackedVector3Array(-6.5, 0.5, 12.5, 6.5, 0.5, 12.5, -6.5, -0.5, 12.5, 6.5, 0.5, 12.5, 6.5, -0.5, 12.5, -6.5, -0.5, 12.5, 6.5, 0.5, -12.5, -6.5, 0.5, -12.5, 6.5, -0.5, -12.5, -6.5, 0.5, -12.5, -6.5, -0.5, -12.5, 6.5, -0.5, -12.5, 6.5, 0.5, 12.5, 6.5, 0.5, -12.5, 6.5, -0.5, 12.5, 6.5, 0.5, -12.5, 6.5, -0.5, -12.5, 6.5, -0.5, 12.5, -6.5, 0.5, -12.5, -6.5, 0.5, 12.5, -6.5, -0.5, -12.5, -6.5, 0.5, 12.5, -6.5, -0.5, 12.5, -6.5, -0.5, -12.5, 6.5, 0.5, 12.5, -6.5, 0.5, 12.5, 6.5, 0.5, -12.5, -6.5, 0.5, 12.5, -6.5, 0.5, -12.5, 6.5, 0.5, -12.5, -6.5, -0.5, 12.5, 6.5, -0.5, 12.5, -6.5, -0.5, -12.5, 6.5, -0.5, 12.5, 6.5, -0.5, -12.5, -6.5, -0.5, -12.5) +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_d1e56"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_u6hdq"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_nlhhs"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_q46da"] + [node name="Game" type="Node"] script = ExtResource("1_iox18") @@ -48,7 +58,6 @@ transform = Transform3D(0.999998, 0, 0, 0, 1, 0, 0, 0, 0.999998, 12, 0, 0) script = ExtResource("2_xl0he") [node name="MeshInstance3D" type="MeshInstance3D" parent="Player2"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) mesh = SubResource("BoxMesh_ognqx") [node name="StaticBody3D" type="StaticBody3D" parent="Player2/MeshInstance3D"] @@ -81,3 +90,39 @@ anchor_right = 0.5 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 + +[node name="VSlider" type="VSlider" parent="Control"] +layout_mode = 1 +anchors_preset = 13 +anchor_left = 0.5 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -39.0 +offset_top = 1.0 +offset_right = -23.0 +offset_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_icons/grabber_disabled = ExtResource("6_agvbb") +theme_override_styles/slider = SubResource("StyleBoxTexture_d1e56") +theme_override_styles/grabber_area = SubResource("StyleBoxTexture_u6hdq") +value = 20.0 +editable = false +scrollable = false + +[node name="VSlider2" type="VSlider" parent="Control"] +layout_mode = 1 +anchors_preset = 13 +anchor_left = 0.5 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = 32.0 +offset_right = 48.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_icons/grabber_disabled = ExtResource("7_n8t7y") +theme_override_styles/slider = SubResource("StyleBoxTexture_nlhhs") +theme_override_styles/grabber_area = SubResource("StyleBoxTexture_q46da") +value = 80.0 +editable = false +scrollable = false diff --git a/scripts/Logic/Game.gd b/scripts/Logic/Game.gd index 65dc349..4d072a8 100644 --- a/scripts/Logic/Game.gd +++ b/scripts/Logic/Game.gd @@ -83,6 +83,7 @@ func _process(delta): if Input.is_action_pressed("test"): emit_signal("shoot") - + $Control/VSlider.value = p1_train.current_distance + $Control/VSlider2.value = p2_train.current_distance diff --git a/undefined - Imgur (1).png b/undefined - Imgur (1).png new file mode 100644 index 0000000000000000000000000000000000000000..61d85d6d80baeb32caa9081f317a34f18abe0e4a GIT binary patch literal 398 zcmV;90df9`P)#~b`JnFfD*uN;%^* zF-{ltDgb4>dp6$RXgpNKAm_yZY)<4)8_m61TDmcay9DOoxoVz!8X%JSEX1$^CX%^? zF!Dve2Y9z1BbrOS`oBX~z+4>`PQBMp1-Qw4CIlcoQnT_E(231^PY+OL04OEEt!*}h zb`l_)6yCq-NIhi&c*$P@{tefsk_~dYP}wWs0h$cnjRcrYEs=DP05&TC2gsDm(D=}r z{WRk0qiuqIo;4^e+HTtz{&L(PaFm5k-Pn9?J(1A@)QyWls9PSF;fi s%8hUQ%w0~Y!5o5JPOm_1yPgBM0Gf7|4yw!EzyJUM07*qoM6N<$f@S}rm;e9( literal 0 HcmV?d00001 diff --git a/undefined - Imgur (1).png.import b/undefined - Imgur (1).png.import new file mode 100644 index 0000000..8a2d729 --- /dev/null +++ b/undefined - Imgur (1).png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b8rsm7uapp583" +path="res://.godot/imported/undefined - Imgur (1).png-0d6247a52be8c4b2fc393c73c25c8a7d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://undefined - Imgur (1).png" +dest_files=["res://.godot/imported/undefined - Imgur (1).png-0d6247a52be8c4b2fc393c73c25c8a7d.ctex"] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +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 diff --git a/undefined - Imgur.png b/undefined - Imgur.png new file mode 100644 index 0000000000000000000000000000000000000000..5db981b7a31fdd666799d406fdefb005e3982c1d GIT binary patch literal 401 zcmV;C0dD?@P)Wyv5QQJEz#*ZXn!u+D4tL-Zu7hhqEzrT0a2*&bkO_$G%!KZMoAs=iH3p6Y{rJt0 zFi7v4l~_F`UDsi)T9xf+Xlk1GwR0>6XjS$A-~b>8u%Gy>0#E`trKb6G0??|A4E2oZ zln6$rrYTnev?{x2PaiTrt^xm8U|HwJMRz#KeR$#YKwcru@b7*;@g zGM5lqzUcP=@Afy3=29>A?~oPHSBJS%@AXpwZZaPM0Z5P3tZW4ifz5kQ3y?p6f6B=46~u9tU;00000NkvXXu0mjf3;D1e literal 0 HcmV?d00001 diff --git a/undefined - Imgur.png.import b/undefined - Imgur.png.import new file mode 100644 index 0000000..822c285 --- /dev/null +++ b/undefined - Imgur.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://44lfs83sax35" +path="res://.godot/imported/undefined - Imgur.png-b336c6cd076a57762001e473ecdfe2b4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://undefined - Imgur.png" +dest_files=["res://.godot/imported/undefined - Imgur.png-b336c6cd076a57762001e473ecdfe2b4.ctex"] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +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