From 24f2c3b9fd31799dc1d70500a1ce627d925f5dc8 Mon Sep 17 00:00:00 2001 From: HumanoidSandvichDispenser Date: Sun, 13 Aug 2023 20:11:40 -0700 Subject: [PATCH] area labels --- Assets/Fonts/calamity/calamity-spaced.tres | 7 + Assets/Sprites/UI/border.ase | Bin 0 -> 879 bytes Assets/Sprites/UI/border.png | Bin 0 -> 396 bytes Assets/Sprites/UI/border.png.import | 34 ++++ Assets/Sprites/UI/menu-center.ase | Bin 0 -> 1247 bytes Assets/Sprites/UI/menu-center.png | Bin 0 -> 480 bytes Assets/Sprites/UI/menu-center.png.import | 34 ++++ Events/AreaChangedArgs.cs | 6 + Events/EventBus.cs | 3 + Scenes/Maps/Arena.tscn | 4 +- Scenes/Maps/ArenaExterior.tscn | 44 ++--- Shaders/Wipe.gdshader | 11 ++ UI/Base.tscn | 8 +- UI/LocationDisplay.cs | 32 +++ UI/LocationDisplay.tscn | 218 +++++++++++++++++++++ Utils/World.cs | 2 + 16 files changed, 374 insertions(+), 29 deletions(-) create mode 100644 Assets/Fonts/calamity/calamity-spaced.tres create mode 100644 Assets/Sprites/UI/border.ase create mode 100644 Assets/Sprites/UI/border.png create mode 100644 Assets/Sprites/UI/border.png.import create mode 100644 Assets/Sprites/UI/menu-center.ase create mode 100644 Assets/Sprites/UI/menu-center.png create mode 100644 Assets/Sprites/UI/menu-center.png.import create mode 100644 Events/AreaChangedArgs.cs create mode 100644 Shaders/Wipe.gdshader create mode 100644 UI/LocationDisplay.cs create mode 100644 UI/LocationDisplay.tscn diff --git a/Assets/Fonts/calamity/calamity-spaced.tres b/Assets/Fonts/calamity/calamity-spaced.tres new file mode 100644 index 0000000..f794095 --- /dev/null +++ b/Assets/Fonts/calamity/calamity-spaced.tres @@ -0,0 +1,7 @@ +[gd_resource type="FontVariation" load_steps=2 format=3 uid="uid://cnjpt3yy746ob"] + +[ext_resource type="FontFile" uid="uid://6bvgjbmqovau" path="res://Assets/Fonts/calamity/calamity.ttf" id="1_m4w5i"] + +[resource] +base_font = ExtResource("1_m4w5i") +spacing_glyph = 4 diff --git a/Assets/Sprites/UI/border.ase b/Assets/Sprites/UI/border.ase new file mode 100644 index 0000000000000000000000000000000000000000..f593068f9642450438f6acef9bec393d40281514 GIT binary patch literal 879 zcmcJOPe_wt9LIn5PA6uHe`3jN?(HC`=$03qgEXcq%q({qDrmm>ClPHFimO9TLp_KE zhL9qq2fpu>ADkT?g6j(la6b}(#|H=SPb>y=Q!LP_ ztGS*6wWqH_?P=B(!$4~p93HHJpJtxI)rdO7=LeZ^<%tfrU+2Tgt6~x zVo%>aI6lz~r^C#--IPWC#-%~2|Je_!^zEVD38?6 zMqm^=rqpjeYhPe6x&@bhY{2XKeP}Q8L&u#qSn2DB_0PwlIkyP))I3;XQyIO5RnX^D zhC_|&%rgT!Fg*V|zRO69dUI51ltVMrLMIeL8&p9Llt2UM$35b)j&gh>8`EgUF@mv+ zTD&3^qv*sXBC&`<{2>o>Xu}!8u!Sl-Aqhk1!3|=tf)acn0~2V#0Rl)*baE4##Ka{l zK}ktO@)3??#ImbY27iw8MO?AUL-SSVOQY1qL!u$Xwo05=_}_AfCc(M(w!2~`6^pl_ V@y5u!rA$5~-kRD;lEaYZJq6Ed1GxYI literal 0 HcmV?d00001 diff --git a/Assets/Sprites/UI/border.png b/Assets/Sprites/UI/border.png new file mode 100644 index 0000000000000000000000000000000000000000..181cc5e129e71f4fd0fa8647442677145a6eaa4f GIT binary patch literal 396 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sX99deT!AzPGatXOh_t-Cp}9p^ zT4GLHgB-J<6}Pyzqsfgi3{e0j7mE7z^PJ8J66 z^liuM_T6m0{%ppZk2`psWQ4+Gbu09p`|MIz`1c;nVDPI@$Zyq~G{b4{){2`)R=nOX zD(x<>6{csKU>8{8o7bK=XQ?!goUXWztEPRRequw!!kMLKRxbFevCGN_=pUDoAirRS z|CEDG+MZ=V^Rzu(978-hlM^IZP1p||;o#zS7MOB?En$;_OB?Uv1d*PmKm#tfgBl9_ a3=F%?m|ZVN8wvuoF?hQAxvXDO+nDB7rZ(oxLxPpNk||`OR+vkSh-8sEnYNfpnxzuWn3!p3VF@W> z`Cw^al$KPYX&6FCk8T7-P+&!7P5Z<2-Nc0;-~7XT^M^acZun`gmVhkiHp~pNfSojR)YPZaKrXT`sUELk)+^yx~NH?EYy`CplIE zO|NCgqj@`E)rGyVq2mzj89oF1Co16B+pF-y%mcVG+7r5@u7iFh0WhX65@xsWhP8u- zp-7T9YYQr&f4!`Y?z<05CWc`9`^V5#y%TCSrb7R%nJ`j!0w(5HL49)@RNH$&KR20i z`-W{$7a$EA_sE$Wi$`F`^{?hpT3X6~j$9hcVKc0Sov;wL!7A7TOJD=&$35b)j&gh> z8`EgUF@mv+TD&3^qv*sXBC&`<{2>o>Xu}!8u!Sl-Aqhk1!3|=tf)acn0~2V#0Rl)* zbaE4##Ka{lK}ktO@)3??#L~!AS_?S$5LeiU1bu0Cp*CptSUGpb_u}KwrK^LNJ`M@v zIxDTb+ftb4dqfFqQPP~1X%u?vdQtuCh{~t1Ip#f+3ZQ%7TRh zWwn>$)(mJ>F-3O`=Gd)e(oQ%cME7gKib h%I5`BN+)N{^z0-`CQ%n`&+kue)%H9#iB3G z=cFMXXepoQt&<;T)>!T`Z)Vc2%?NEBt#8W-$0wDCD>5O`74fcWcGXBP(9- z7nOFG*9z0KO|T0r@y%;boU>G#M^0B<$5qolP(QIDV&TlvGbV#>< zPqsESHvNURPtqrM=^mTqylMkq!B<@-WBw|s8Ov`m?PghX{{BryS5rReBgyl20-eI( M>FVdQ&MBb@0MNJNqyPW_ literal 0 HcmV?d00001 diff --git a/Assets/Sprites/UI/menu-center.png.import b/Assets/Sprites/UI/menu-center.png.import new file mode 100644 index 0000000..3b4d29e --- /dev/null +++ b/Assets/Sprites/UI/menu-center.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://t467i5xou4ug" +path="res://.godot/imported/menu-center.png-fa37aff35ac70bec324c3aa847f905cd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Sprites/UI/menu-center.png" +dest_files=["res://.godot/imported/menu-center.png-fa37aff35ac70bec324c3aa847f905cd.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 diff --git a/Events/AreaChangedArgs.cs b/Events/AreaChangedArgs.cs new file mode 100644 index 0000000..065103d --- /dev/null +++ b/Events/AreaChangedArgs.cs @@ -0,0 +1,6 @@ +namespace SupaLidlGame.Events; + +public partial class AreaChangedArgs : Args +{ + public Scenes.Map Map { get; set; } +} diff --git a/Events/EventBus.cs b/Events/EventBus.cs index 2661ef1..2f93bbc 100644 --- a/Events/EventBus.cs +++ b/Events/EventBus.cs @@ -7,6 +7,9 @@ public partial class EventBus : Node [Signal] public delegate void RequestMoveToAreaEventHandler(RequestAreaArgs args); + [Signal] + public delegate void AreaChangedEventHandler(Scenes.Map map); + [Signal] public delegate void PlayerDeathEventHandler(HurtArgs args); diff --git a/Scenes/Maps/Arena.tscn b/Scenes/Maps/Arena.tscn index e1687d6..f647150 100644 --- a/Scenes/Maps/Arena.tscn +++ b/Scenes/Maps/Arena.tscn @@ -11,7 +11,7 @@ [ext_resource type="PackedScene" uid="uid://dldnp8eunxj3q" path="res://BoundingBoxes/InteractionTrigger.tscn" id="9_3401j"] [ext_resource type="Script" path="res://BoundingBoxes/ConnectorBox.cs" id="9_fg062"] -[sub_resource type="ShaderMaterial" id="ShaderMaterial_pg4a6"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_7dryp"] resource_local_to_scene = true shader = ExtResource("5_h8k5p") shader_parameter/color = Vector4(1, 1, 1, 1) @@ -113,7 +113,7 @@ visible = false position = Vector2(120, -112) [node name="Doc" parent="Entities" index="0" instance=ExtResource("4_ej0f3")] -material = SubResource("ShaderMaterial_pg4a6") +material = SubResource("ShaderMaterial_7dryp") [node name="PointLight2D" type="PointLight2D" parent="Entities" index="1"] position = Vector2(168, -42) diff --git a/Scenes/Maps/ArenaExterior.tscn b/Scenes/Maps/ArenaExterior.tscn index 24cbf76..842a50e 100644 --- a/Scenes/Maps/ArenaExterior.tscn +++ b/Scenes/Maps/ArenaExterior.tscn @@ -161,70 +161,70 @@ size = Vector2(64, 97) [sub_resource type="RectangleShape2D" id="RectangleShape2D_5pcme"] size = Vector2(18, 6) -[sub_resource type="ShaderMaterial" id="ShaderMaterial_vw5b5"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_1q1be"] resource_local_to_scene = true shader = ExtResource("28_b3suq") shader_parameter/color = Vector4(1, 1, 1, 1) shader_parameter/intensity = 0.0 shader_parameter/alpha_modulate = 1.0 -[sub_resource type="ShaderMaterial" id="ShaderMaterial_8p2xl"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_obny8"] resource_local_to_scene = true shader = ExtResource("28_b3suq") shader_parameter/color = Vector4(1, 1, 1, 1) shader_parameter/intensity = 0.0 shader_parameter/alpha_modulate = 1.0 -[sub_resource type="ShaderMaterial" id="ShaderMaterial_ndk4b"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_exlka"] resource_local_to_scene = true shader = ExtResource("28_b3suq") shader_parameter/color = Vector4(1, 1, 1, 1) shader_parameter/intensity = 0.0 shader_parameter/alpha_modulate = 1.0 -[sub_resource type="ShaderMaterial" id="ShaderMaterial_yll4k"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_ec2v5"] resource_local_to_scene = true shader = ExtResource("28_b3suq") shader_parameter/color = Vector4(1, 1, 1, 1) shader_parameter/intensity = 0.0 shader_parameter/alpha_modulate = 1.0 -[sub_resource type="ShaderMaterial" id="ShaderMaterial_yuyxc"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_ohpa0"] resource_local_to_scene = true shader = ExtResource("28_b3suq") shader_parameter/color = Vector4(1, 1, 1, 1) shader_parameter/intensity = 0.0 shader_parameter/alpha_modulate = 1.0 -[sub_resource type="ShaderMaterial" id="ShaderMaterial_ecd57"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_aiu1q"] resource_local_to_scene = true shader = ExtResource("28_b3suq") shader_parameter/color = Vector4(1, 1, 1, 1) shader_parameter/intensity = 0.0 shader_parameter/alpha_modulate = 1.0 -[sub_resource type="ShaderMaterial" id="ShaderMaterial_ewmj1"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_bf84d"] resource_local_to_scene = true shader = ExtResource("28_b3suq") shader_parameter/color = Vector4(1, 1, 1, 1) shader_parameter/intensity = 0.0 shader_parameter/alpha_modulate = 1.0 -[sub_resource type="ShaderMaterial" id="ShaderMaterial_k255s"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_7skkn"] resource_local_to_scene = true shader = ExtResource("28_b3suq") shader_parameter/color = Vector4(1, 1, 1, 1) shader_parameter/intensity = 0.0 shader_parameter/alpha_modulate = 1.0 -[sub_resource type="ShaderMaterial" id="ShaderMaterial_4sns8"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_soae1"] resource_local_to_scene = true shader = ExtResource("28_b3suq") shader_parameter/color = Vector4(1, 1, 1, 1) shader_parameter/intensity = 0.0 shader_parameter/alpha_modulate = 1.0 -[sub_resource type="ShaderMaterial" id="ShaderMaterial_w1raa"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_to8fm"] resource_local_to_scene = true shader = ExtResource("28_b3suq") shader_parameter/color = Vector4(1, 1, 1, 1) @@ -241,8 +241,8 @@ layer_4/tile_data = PackedInt32Array(2097150, 655360, 2, 2359293, 655360, 1, 235 CameraLowerBound = Vector2(0, 0) CameraUpperBound = Vector2(0, 0) ClearColor = Color(0.105882, 0.0470588, 0.117647, 1) -AreaName = "Depths of the Arena" -MapName = "The Arena" +AreaName = "The Arena" +MapName = "Depths of the Arena" [node name="CanvasModulate" parent="." index="0"] color = Color(0.5, 0.5, 0.5, 1) @@ -677,43 +677,43 @@ position = Vector2(256, -9) position = Vector2(80, 373) [node name="Centurion" parent="Entities" index="7" instance=ExtResource("30_qfl2k")] -material = SubResource("ShaderMaterial_vw5b5") +material = SubResource("ShaderMaterial_1q1be") position = Vector2(-360, 31) [node name="Centurion2" parent="Entities" index="8" instance=ExtResource("30_qfl2k")] -material = SubResource("ShaderMaterial_8p2xl") +material = SubResource("ShaderMaterial_obny8") position = Vector2(-224, 131) [node name="Legionary" parent="Entities" index="9" instance=ExtResource("27_84gw4")] -material = SubResource("ShaderMaterial_ndk4b") +material = SubResource("ShaderMaterial_exlka") position = Vector2(-214, 72) [node name="Legionary2" parent="Entities" index="10" instance=ExtResource("27_84gw4")] -material = SubResource("ShaderMaterial_yll4k") +material = SubResource("ShaderMaterial_ec2v5") position = Vector2(-496, 15) [node name="Legionary3" parent="Entities" index="11" instance=ExtResource("27_84gw4")] -material = SubResource("ShaderMaterial_yuyxc") +material = SubResource("ShaderMaterial_ohpa0") position = Vector2(-240, 152) [node name="Legionary4" parent="Entities" index="12" instance=ExtResource("27_84gw4")] -material = SubResource("ShaderMaterial_ecd57") +material = SubResource("ShaderMaterial_aiu1q") position = Vector2(-300, 384) [node name="Legionary5" parent="Entities" index="13" instance=ExtResource("27_84gw4")] -material = SubResource("ShaderMaterial_ewmj1") +material = SubResource("ShaderMaterial_bf84d") position = Vector2(-300, 401) [node name="Legionary6" parent="Entities" index="14" instance=ExtResource("27_84gw4")] -material = SubResource("ShaderMaterial_k255s") +material = SubResource("ShaderMaterial_7skkn") position = Vector2(-316, 425) [node name="Legionary7" parent="Entities" index="15" instance=ExtResource("27_84gw4")] -material = SubResource("ShaderMaterial_4sns8") +material = SubResource("ShaderMaterial_soae1") position = Vector2(-300, 449) [node name="Legionary8" parent="Entities" index="16" instance=ExtResource("27_84gw4")] -material = SubResource("ShaderMaterial_w1raa") +material = SubResource("ShaderMaterial_to8fm") position = Vector2(-404, 505) [editable path="Props/StaticBookshelf"] diff --git a/Shaders/Wipe.gdshader b/Shaders/Wipe.gdshader new file mode 100644 index 0000000..7cebd6d --- /dev/null +++ b/Shaders/Wipe.gdshader @@ -0,0 +1,11 @@ +shader_type canvas_item; + +uniform float amount : hint_range(0.5, 1.0, 0.01) = 1; + +void fragment() { + // Place fragment code here. + //COLOR = texture(TEXTURE, UV); + if (UV.x > amount || UV.x < 1.0 - amount) { + COLOR.a = 0.0; + } +} diff --git a/UI/Base.tscn b/UI/Base.tscn index 50aacf4..7770bdc 100644 --- a/UI/Base.tscn +++ b/UI/Base.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=5 format=3 uid="uid://c271rdjhd1gfo"] +[gd_scene load_steps=6 format=3 uid="uid://c271rdjhd1gfo"] [ext_resource type="PackedScene" uid="uid://73jm5qjy52vq" path="res://Dialogue/balloon.tscn" id="1_atjb1"] [ext_resource type="Script" path="res://UI/UIController.cs" id="2_b4b6l"] [ext_resource type="PackedScene" uid="uid://bxo553hblp6nf" path="res://UI/HealthBar.tscn" id="3_j1j6h"] [ext_resource type="PackedScene" uid="uid://01d24ij5av1y" path="res://UI/BossBar.tscn" id="4_igi28"] +[ext_resource type="PackedScene" uid="uid://c77754nvmckn" path="res://UI/LocationDisplay.tscn" id="5_cr6vo"] [node name="BaseUI" type="CanvasLayer"] @@ -71,7 +72,4 @@ alignment = 1 visible = false layout_mode = 2 -[node name="Location" type="Control" parent="SubViewportContainer/UIViewport/MainUILayer/Main"] -anchors_preset = 0 -offset_right = 40.0 -offset_bottom = 40.0 +[node name="LocationDisplay" parent="SubViewportContainer/UIViewport/MainUILayer" instance=ExtResource("5_cr6vo")] diff --git a/UI/LocationDisplay.cs b/UI/LocationDisplay.cs new file mode 100644 index 0000000..eb3ab8a --- /dev/null +++ b/UI/LocationDisplay.cs @@ -0,0 +1,32 @@ +using Godot; +using SupaLidlGame.Extensions; + +namespace SupaLidlGame.UI; + +public partial class LocationDisplay : CenterContainer +{ + private Label _mapName; + private Label _subtitle; + private AnimationPlayer _animPlayer; + + public override void _Ready() + { + _mapName = GetNode