how to reduce batch when draw text.

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

I captured one frame of my project with Xcode. Then I fount that there are too many batch when draw text, Almost every word has one batch . For my own engine before, If the words are in the same font bitmap, It will only use one batch to render them all.

So. how can i solve the problem?

I don’t think you can without modifying the engine. You could post a Github issue about this to ask for a way to batch text drawing more efficiently?

Zylann | 2017-09-04 12:43

:bust_in_silhouette: Reply From: volzhs

There is a CanvasItem.draw_string method.
you can use it in func _draw():
this might help.

I’ll try it.

CrazyLab | 2017-09-04 16:01