Replies: 1 comment
-
I would add a component storing the text entity to your struct ChangeTextOnClicked
{
text_entity: Entity,
} Then you can replace your children_query iteration by a simpler direct get for the Text component on the This approach can also help with having different |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to get some buttons to change their text on click. I have some entities with ButtonBundle each with a single child containing TextBundle.
This is the thing I came up. Using a query on children to find the text component. But it looks horrible tbh for such a simple thing. And it's a mess to refactor into a separate function.
Is there a more sane way to do this?
Beta Was this translation helpful? Give feedback.
All reactions