- Home /
Is updating 1 character in a 200 character Text object more expensive than a 10 character Object
A. Does Unity Text cache the pixels being printed to screen and only update they that change?
OR
B. Does Unity Text rewrite all pixels in the Text every time it gets set?
Answer by andrew-lukasik · Jul 05, 2021 at 05:47 PM
Font data is cached as textures - yes. UnityEngine.UI.Text
component's "pixels" are not cached anywhere. Any string
you wish to display is converted into a stream of vertex data (vertex pos,uv coords etc.), more commonly known as a "mesh", and sent to GPU for rendering.
So
Is updating 1 character in a 200 character
Text
object more expensive than a 10 character Object
no. It doesn't matter (for GPU). Just make sure you're not re-creating this string
every frame (on CPU-side) because that would make a small difference indeed (GC pressure).
Your answer
![](https://koobas.hobune.stream/wayback/20220613035848im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Finding the height of a text asset. 1 Answer
Reading in level data from a text file 1 Answer
Basic Question about TextAssets 0 Answers
when loading a textasset from .txt file, the quotations disappear?? 1 Answer
How does a TextAsset work? 1 Answer