_
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?
_
_
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?
_
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).