+1 vote

What's the best way to implement this on a Label node? Prorammatically of course because it depends on the dialogue.

enter image description here

in Engine by (142 points)

1 Answer

+2 votes

A dirty way would be to create a label for each letter and modify their position every frame, but you need to basically reprogram how to layout the characters in the bubble.

Another way is to use a texture to store an animated pre-rendered text. This is the most efficient in terms of performance, but it consumes more memory and the workflow is horrible.

It could be done with a shader but it needs investigation:
You would have a texture A containing the characters (bitmap font), and another texture B which stores coloured rectangles encompassing the characters. This way, when Godot draws the label, you can tell which letter you are drawing according to the colour of B and modify the vertex shader to offset the letters.
This is the smartest way because it's very fast, and you just need to assign a material. But I doubt Godot provides access to the font's texture (should be investigated).

It could also be a text effect built into Godot, because it is closely related to how it renders text, but this is far from happening IMO.

by (29,120 points)
edited by

Thank you for your tips! I guess I have a long road ahead of me then xD

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.