Draw.Text with a StringBuilder

Avatar

I'm currently building a system that shows text that changes every frame, I want to avoid allocating lots of strings. Normally with TextMeshPro I'd just use one of the SetText overloads (e.g. accepting StringBuilder). As long as the `text` property is never accessed, no string ever gets allocated (TMP uses char arrays internally).

However, that dosn't seem to be possible with `Draw.Text`.

Because all of the overloads accept a `string`, I'm forced to allocate. Maybe I've missed some workaround though?


If not, would it be possible to add 2 new sets of overloads here:

1. One set of overloads with `string content` replaced with `StringBuilder content`.

2. Another set of overloads that don't take any content string at all! We can set it overselves by calling `SetText` directly on the `TextElement.Tmp`.

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
URP