added basic dialogue bubble functionality

This commit is contained in:
2023-02-03 20:24:45 +01:00
parent d119321104
commit bf09061c5e
8 changed files with 74 additions and 55 deletions

View File

@@ -1,15 +1,15 @@
[gd_scene load_steps=4 format=3 uid="uid://cg86tsupfq53i"]
[gd_scene load_steps=4 format=3 uid="uid://bkm7365u1mm3o"]
[ext_resource type="Script" path="res://src/scene-scripts/dialog_bubble.cs" id="1_210k6"]
[ext_resource type="Script" path="res://src/scene-scripts/dialogue-system/dialog_bubble.cs" id="1_5xn2c"]
[ext_resource type="FontFile" uid="uid://cx6bvqk0ghmjv" path="res://assets/fonts/urbane-rounded-medium.otf" id="2_qrihj"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5w2xu"]
[node name="dialog_bubble" type="CanvasLayer"]
script = ExtResource("1_210k6")
script = ExtResource("1_5xn2c")
metadata/_edit_use_anchors_ = true
[node name="color_rect" type="ColorRect" parent="."]
[node name="box" type="ColorRect" parent="."]
anchors_preset = -1
anchor_left = 0.083
anchor_top = 0.694
@@ -22,7 +22,7 @@ offset_bottom = 19.6479
grow_horizontal = 2
grow_vertical = 0
[node name="text_label" type="RichTextLabel" parent="color_rect"]
[node name="rich_text_label" type="RichTextLabel" parent="box"]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.034
@@ -40,10 +40,9 @@ theme_override_fonts/normal_font = ExtResource("2_qrihj")
theme_override_font_sizes/normal_font_size = 32
theme_override_font_sizes/bold_font_size = 80
bbcode_enabled = true
text = "this is test text or [center][b][wave amp=50 freq=15][rainbow]This is test text[/rainbow][/wave][/b][/center]"
scroll_active = false
[node name="name_label" type="Label" parent="color_rect"]
[node name="name_label" type="Label" parent="box"]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.01
@@ -56,42 +55,44 @@ offset_right = 0.389984
offset_bottom = 0.118996
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_fonts/font = ExtResource("2_qrihj")
theme_override_font_sizes/font_size = 32
theme_override_font_sizes/font_size = 36
text = "???"
[node name="PanelContainer" type="PanelContainer" parent="."]
[node name="panel_container" type="PanelContainer" parent="box"]
visible = false
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -466.0
offset_top = -312.0
offset_right = -144.0
offset_bottom = -239.0
offset_left = -307.0
offset_top = -304.0
offset_right = 15.0
offset_bottom = -231.0
grow_horizontal = 0
grow_vertical = 0
size_flags_horizontal = 8
size_flags_vertical = 8
theme_override_styles/panel = SubResource("StyleBoxEmpty_5w2xu")
[node name="NinePatchRect" type="NinePatchRect" parent="PanelContainer"]
[node name="nine_patch_rect" type="NinePatchRect" parent="box/panel_container"]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
[node name="margin_container" type="MarginContainer" parent="box/panel_container"]
layout_mode = 2
theme_override_constants/margin_left = 15
theme_override_constants/margin_top = 15
theme_override_constants/margin_right = 15
theme_override_constants/margin_bottom = 15
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"]
[node name="v_box_container" type="VBoxContainer" parent="box/panel_container/margin_container"]
layout_mode = 2
[node name="Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
[node name="button" type="Button" parent="box/panel_container/margin_container/v_box_container"]
custom_minimum_size = Vector2(128, 32)
layout_mode = 2
theme_override_fonts/font = ExtResource("2_qrihj")
theme_override_font_sizes/font_size = 28
text = "i want to hear more"
text = "---"
alignment = 0

View File

@@ -2,7 +2,7 @@
[ext_resource type="Script" path="res://src/scene-scripts/player.cs" id="1_qehox"]
[ext_resource type="Texture2D" uid="uid://olceowuycu8c" path="res://assets/textures/debug/dummy-player-atlas.png" id="2_yu1q5"]
[ext_resource type="PackedScene" uid="uid://cg86tsupfq53i" path="res://scenes/gui/dialog_bubble.tscn" id="3_8f573"]
[ext_resource type="PackedScene" uid="uid://bkm7365u1mm3o" path="res://scenes/gui/dialog_bubble.tscn" id="3_8f573"]
[sub_resource type="AtlasTexture" id="AtlasTexture_tokqm"]
atlas = ExtResource("2_yu1q5")
@@ -132,3 +132,4 @@ editor_draw_drag_margin = true
current = true
[node name="dialog_bubble" parent="." instance=ExtResource("3_8f573")]
visible = false

View File

@@ -19,7 +19,8 @@ position = Vector2(0, 20.625)
shape = SubResource("RectangleShape2D_pchpi")
[node name="dialog_trigger_area" parent="." instance=ExtResource("2_blpmd")]
dialogFile = "res://dialogue/npcs/villager_normal.json"
file = "res://dialogue/npcs/villager_normal.json"
title = "Debug cupcake"
[node name="collision_shape_2d" parent="dialog_trigger_area" index="0"]
shape = SubResource("RectangleShape2D_d78tr")