Can you use a TextMeshPro in an Entity?

Can you use a TextMeshPro in an Entity?

A couple of options you might be interested in:

2 Likes

Thanks for that. I have done a test and can move my GameObject turned Entity with a JOB. That’s great. How do you get access to the TextRender’s Text property from code? And I presume you can’t in Burst compiled code?

I’ll speak for Calligraphics. There is a TextRendererAspect which has a text property which gives you a CalliString. This is a mutable structure backed by a DynamicBuffer. You can use a bunch of the Collections package extension methods to append characters, numbers, and other fixed string instances to it.

Additionally, you can construct the CalliString directly from a DynamicBuffer.

You totally can, though sometimes Burst can get tripped up by usages of sting literals in certain places.

1 Like