How would i go about implementing something like this on Labels?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By user41420082
:warning: Old Version Published before Godot 3 was released.

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

:bust_in_silhouette: Reply From: Zylann

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.

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

user41420082 | 2016-07-23 21:52