You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been learning the new UI components in Bevy 0.15. I found the text component to be counter intuitive. For example when I was trying to make a simple UI element with centered text. I constructed the following entity. I expect that the text would show up centered on the UI element.
For simple UI elements like buttons, I would expect that the Text component would be part of the same entity where I would control the color of the border or background for simple hover and button press logic. Would it be possible to refactor the Text component to work that way? Or is there a way to get the Text component to align without making a separate entity?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have been learning the new UI components in Bevy 0.15. I found the text component to be counter intuitive. For example when I was trying to make a simple UI element with centered text. I constructed the following entity. I expect that the text would show up centered on the UI element.
However I found that what I needed to do was separate out the text into a child entity of the first element with the following code.
For simple UI elements like buttons, I would expect that the Text component would be part of the same entity where I would control the color of the border or background for simple hover and button press logic. Would it be possible to refactor the Text component to work that way? Or is there a way to get the Text component to align without making a separate entity?
Beta Was this translation helpful? Give feedback.
All reactions