dialogic-godot / dialogic

💬 Create Dialogs, Visual Novels, RPGs, and manage Characters with Godot to create your Game!
https://dialogic.pro
MIT License
3.54k stars 216 forks source link

Make long text event automatically split into several text messages. #133

Open coppolaemilio opened 3 years ago

coppolaemilio commented 3 years ago

If the text for a message is too long, it will overflow the container: image

Describe the solution you'd like Dialogic should automatically split the long messages into several text events that don't overflow the current dialog box.

Describe alternatives you've considered The only alternative right now is to test your messages and splitting them into several events (or lines) so it fits. This will become an issue when needing to test many text messages in translated games. We can't expect the user to be manually checking the entire game in all languages to break the messages evenly. This would also create a problem if you are displaying definitions (variables) that make your text overflow.

AnidemDex commented 3 years ago

Changing RichTextLabel's rect_clip_content property to true may temporarily solve the visual problems, leaving only the problem of splitting the event into multiple events.

Edit: image Here's one example

hsandt commented 1 month ago

An offline alternative would be to give an editor shortcut to auto-split a long text into two. For instance, if you Shift+Enter it breaks the text at the caret and put the remaining part on a copy of the text node (same character speaking) with the 2nd part of the text.

Since it's an offline solution, it wouldn't help with dynamic chances like user increasing text font size, or localization leading to longer sentences.

CakeVR commented 1 month ago

While not automatic, in Dialogic 2, you can split messages into several events or appended text:

image

hsandt commented 1 month ago

Thx, I just found about [n] (new event) and [n+] (new event appended) which would replace the need for a manual split command.

AnidemDex commented 1 month ago

This issue is still open 😅

If this is something that dialogic internally cares about, it can calculate the string size in screen before displaying it, determining if it should be split in many more events or if it should just clip the text (it was possible in Godot 3, is now easier with Godot 4), but I personally feel that this is something that the user should handle, not dialogic