Mostly finished VN textbox

This commit is contained in:
2025-09-16 23:27:02 -05:00
parent 96b5bae9d0
commit 1e83200bba
7 changed files with 132 additions and 126 deletions

View File

@@ -1,11 +1,11 @@
[gd_scene load_steps=5 format=3 uid="uid://bkx3l0kckf4a8"]
[gd_scene load_steps=4 format=3 uid="uid://bkx3l0kckf4a8"]
[ext_resource type="Theme" uid="uid://dm7ee4aqjr2dl" path="res://ui/UI Theme.tres" id="1_wx4lp"]
[ext_resource type="Script" uid="uid://h8lw23ypcfty" path="res://ui/component/VNTextbox.gd" id="2_uo1gm"]
[ext_resource type="Script" uid="uid://c6av3xe4m2ujl" path="res://addons/madtalk/runtime/madtalk_runtime.gd" id="3_2x6s1"]
[ext_resource type="Script" uid="uid://bjj6upgk1uvxd" path="res://ui/component/advancedrichtext/AdvancedRichText.gd" id="3_m60k3"]
[node name="VNTextbox" type="PanelContainer"]
clip_contents = true
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
@@ -16,13 +16,8 @@ grow_vertical = 0
theme = ExtResource("1_wx4lp")
script = ExtResource("2_uo1gm")
[node name="MadTalk" type="Node" parent="."]
script = ExtResource("3_2x6s1")
DialogMainControl = NodePath("..")
DialogMessageBox = NodePath("../MarginContainer")
DialogMessageLabel = NodePath("../MarginContainer/Label")
[node name="MarginContainer" type="MarginContainer" parent="."]
clip_contents = true
layout_mode = 2
theme = ExtResource("1_wx4lp")
theme_override_constants/margin_left = 4
@@ -34,8 +29,43 @@ theme_override_constants/margin_bottom = 4
layout_mode = 2
theme = ExtResource("1_wx4lp")
bbcode_enabled = true
text = "To get through tight spaces, press[input action=down][/input]"
fit_content = true
text = "Hello, I'm an NPC!
This is the second line here, I am purposefully adding a tonne of words so that it is forced to go across multiple lines and you can see how the word wrapping works, not only using Godot's built in word wrapping but with my advanced visibile characters smart wrapping. Now I am doing a multiline thing
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10"
script = ExtResource("3_m60k3")
userText = "To get through tight spaces, press[input action=down][/input]"
finalText = "To get through tight spaces, press[img height=12 valign=center,center]res://ui/input/down.tres[/img]"
userText = "Hello, I'm an NPC!
This is the second line here, I am purposefully adding a tonne of words so that it is forced to go across multiple lines and you can see how the word wrapping works, not only using Godot's built in word wrapping but with my advanced visibile characters smart wrapping. Now I am doing a multiline thing
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10"
_finalText = "Hello, I'm an NPC!
This is the second line here, I am purposefully adding a tonne of words so that it is forced to go across multiple lines and you can see how the word wrapping works, not only using Godot's built in word wrapping but with my advanced visibile characters smart wrapping. Now I am doing a multiline thing
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10"
_newLineIndexes = Array[int]([0])
_lines = PackedStringArray("Hello, I\'m an NPC!", "This is the second line here, I am purposefully adding a tonne of words so that it is forced to go across multiple lines and you can see how the word wrapping works, not only using Godot\'s built in word wrapping but with my advanced visibile characters smart wrapping. Now I am doing a multiline thing", "Line 1", "Line 2", "Line 3", "Line 4", "Line 5", "Line 6", "Line 7", "Line 8", "Line 9", "Line 10")
maxLines = 4