-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Remove TextSpan
#21231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Remove TextSpan
#21231
Conversation
* Removed `TextFont` and `TextColor` from the `Text`, `Text2d`, and `TextSpan` requires, replaced with `ComputedTextStyle`. * `update_text_styles` updates the `ComputedTextStyle`s each frame from the text entities nearest ancestors with `TextFont` or `TextColor` components.
Updated more examples
…nto remove-textspan
It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note. Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes. |
Assuming we can get the perf not-terrible, I am strongly in favor of this direction. The distinction felt very fragile and confusing to me. |
Objective
Remove
TextSpan
. Instead, descendant text entities use the same primary component (Text
orText2d
) as their root text entity.Fixes #21226
Solution
Remove
TextSpan
.Root text entities are identified by querying for their parent to see if it is also a text entity.
Testing
Examples (those that have been updated) seem to work.
Not optimised yet, so quite a bit slower.
Showcase