Replies: 2 comments 1 reply
-
So far I've added a way to convert a floating point to a character array. https://github.com/InitialPrefabs/UGUIDOTS/blob/feature/dynamic-text/UGUIDOTS.Common/NumericUtils.cs Next is figuring point 3. The spans need to be rebuilt. |
Beta Was this translation helpful? Give feedback.
-
This has been a very fun process in trying to figure out how to rebuild text dynamically. Currently, what I have is that all static elements are built first and all dynamic elements are built last. All dynamic texts are put in a min priority queue so that we process earlier submesh indices first. I will have to do some optimizations for the min heap, because I only did a naive implementation, but here is a video of what it currently looks like with two different fonts and the text updating every frame. truly-dynamic-text-with-2-different-fonts.mov |
Beta Was this translation helpful? Give feedback.
-
I'm currently trying to figure out the best way to rebuild dynamic text elements. Currently static elements are pretty easy since vertices are just resized to accommodate for a new screen resolution.
Dynamic text can be described in two ways:
Generally, I think it would be better if any changing text is considered dynamic despite being fixed length or variable length.
The RebuildRenderHierarchySystem currently has an implementation to try to build dynamic text last (although it doesn't work the way I'd like it to work). The idea is that all static elements are rebuilt first and the vertices generated are copied to the Canvas entity's Vertex buffer. The index buffer doesn't need to change because these elements are static. Dynamic text should be built last. so the idea would be.
So the general steps are:
I'll need to rework the RebuildRenderHierarchy system to better support this because entities are collected amongst different threads. I'll also be updating this discussion/forum feature from Github as public notes as I try to figure it out.
Beta Was this translation helpful? Give feedback.
All reactions