From 6a5e46b2b36aa2205ba1e5ebe063e9e96dc83391 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sun, 16 Aug 2020 11:52:59 +0200 Subject: [PATCH] Improvev dialog box font size and shrink nameplate background to content --- fonts/dialog_default_font.tres | 1 + scenes/dialogue.tscn | 39 ++++++++++++++++++---------------- scripts/DialogueBox.gd | 1 + 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/fonts/dialog_default_font.tres b/fonts/dialog_default_font.tres index 835c837..82c3c6d 100644 --- a/fonts/dialog_default_font.tres +++ b/fonts/dialog_default_font.tres @@ -4,4 +4,5 @@ [resource] outline_color = Color( 0, 0, 0, 1 ) +extra_spacing_bottom = -6 font_data = ExtResource( 1 ) diff --git a/scenes/dialogue.tscn b/scenes/dialogue.tscn index 9f435a0..616477a 100644 --- a/scenes/dialogue.tscn +++ b/scenes/dialogue.tscn @@ -99,10 +99,10 @@ __meta__ = { } [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer"] -margin_top = 61.0 -margin_right = 184.0 -margin_bottom = 74.0 -size_flags_horizontal = 3 +margin_top = 50.0 +margin_right = 22.0 +margin_bottom = 83.0 +size_flags_horizontal = 0 size_flags_stretch_ratio = 0.2 custom_constants/margin_right = 4 custom_constants/margin_left = 4 @@ -114,8 +114,8 @@ __meta__ = { show_behind_parent = true material = SubResource( 5 ) margin_left = 4.0 -margin_right = 180.0 -margin_bottom = 13.0 +margin_right = 18.0 +margin_bottom = 33.0 texture = ExtResource( 1 ) patch_margin_left = 1 patch_margin_top = 1 @@ -127,19 +127,21 @@ __meta__ = { [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/MarginContainer"] margin_left = 4.0 -margin_right = 180.0 -margin_bottom = 13.0 +margin_right = 18.0 +margin_bottom = 33.0 +size_flags_horizontal = 0 +custom_constants/margin_right = 4 custom_constants/margin_left = 4 -custom_constants/margin_bottom = -2 [node name="CharacterName" type="RichTextLabel" parent="MarginContainer/VBoxContainer/MarginContainer/MarginContainer"] margin_left = 4.0 -margin_right = 176.0 -margin_bottom = 15.0 -size_flags_horizontal = 3 -size_flags_stretch_ratio = 0.25 +margin_right = 10.0 +margin_bottom = 33.0 +rect_min_size = Vector2( 6, 0 ) +rect_clip_content = false +size_flags_horizontal = 0 custom_fonts/normal_font = ExtResource( 2 ) -text = "Elie" +text = "Ely" fit_content_height = true scroll_active = false __meta__ = { @@ -147,7 +149,8 @@ __meta__ = { } [node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer"] -margin_top = 74.0 +show_behind_parent = true +margin_top = 83.0 margin_right = 184.0 margin_bottom = 108.0 __meta__ = { @@ -158,7 +161,7 @@ __meta__ = { show_behind_parent = true material = SubResource( 5 ) margin_right = 184.0 -margin_bottom = 34.0 +margin_bottom = 25.0 texture = ExtResource( 1 ) patch_margin_left = 10 patch_margin_top = 10 @@ -170,7 +173,7 @@ __meta__ = { [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/MarginContainer2"] margin_right = 184.0 -margin_bottom = 34.0 +margin_bottom = 25.0 custom_constants/margin_right = 6 custom_constants/margin_top = 2 custom_constants/margin_left = 6 @@ -183,7 +186,7 @@ __meta__ = { margin_left = 6.0 margin_top = 2.0 margin_right = 178.0 -margin_bottom = 32.0 +margin_bottom = 23.0 rect_clip_content = false size_flags_horizontal = 3 custom_fonts/normal_font = ExtResource( 2 ) diff --git a/scripts/DialogueBox.gd b/scripts/DialogueBox.gd index 4a4ac84..db79b50 100644 --- a/scripts/DialogueBox.gd +++ b/scripts/DialogueBox.gd @@ -42,6 +42,7 @@ func next() -> void: func _update() -> void: title.text = _dialogue[_index].name + title.rect_min_size.x = title.get_font('normal_font').get_string_size(title.text).x text.text = _dialogue[_index].text #expression = _dialogue[_index].expression