bevyengine / bevyengine/bevy

Change detection for text is more painful after text rework

Open
#15,805 1 comment 1 reaction 0 assignees View on GitHub
A-Text C-Usability D-Modest I-Regression S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

> With the new text stuff, one thing that seems a little rough is that you may have a Text component (with text) or a Text2d or several children with spans. So if you need to "do something when text changes" you have a bunch of different places you have to look for the actual string. With spans, you also have to check the parent if you need components there (like narrowing markers, etc).

> This makes doing change detection on text (for things like "if the text changed, re-localize it") a bit messy. It looks like I'm going to need, for any particular case, multiple systems that cover "all the ways there could be a string squirreled away in there"

- Posted by @brandon-reinhart on [Discord](https://discord.com/channels/691052431525675048/743663673393938453/1293716180829343857)

@ItsDoot and I feel that this could probably be solved with a nice custom SystemParam type that gathers and presents this information.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the Text, Text2d, and span-related components described in the issue, along with the systems that inspect their strings. The proposed direction is a custom SystemParam that gathers text and relevant parent components; done should provide one consistent way to detect text changes across these cases, but the exact API and tests are not specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.