TextMeshDOTS
TextMeshDOTS copied to clipboard
Is there any way to change the sortingOrder?
When place the text with sprite together,if we want to make sure the text render on top of sprite,we need to make sure the sprite's sorting order to negative number. It seems the text renders at sorting order 0. So is there any way to change the text's sorting order value?
There are two things you can try...would be great if you can do that and let me know what works best.
- Change layer here https://github.com/Fribur/TextMeshDOTS/blob/72b5d7f8e0db46727d528fcc027b27bd3fc2f5f1/Authoring/TextRendererAuthoring.cs#L79
- Add
AddComponent<DepthSorted_Tag(entity);here https://github.com/Fribur/TextMeshDOTS/blob/72b5d7f8e0db46727d528fcc027b27bd3fc2f5f1/Authoring/TextRendererAuthoring.cs#L166 (this will reduce performance by ~50%. So for e.g. 10,000 text labels, performance will go from 500 FPS to 200 FPS. But is technically the correct way to do it.