mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
c4f0de52eb
# Objective `TextBundle` should have a `BackgroundColor` component. Apart from adding emphasis etc to text, adding a background color to text nodes can be extremely useful for understanding how Bevy aligns, sizes and positions text, and identifying and debugging problems. It's easy for users to insert the `BackgroundColor` component themselves but not immediately obvious or discoverable that it's possible. A `BackgroundColor` component allows us to add a `with_background_color` helper function to `TextBundle`. related issue: #5935 ## Solution Add a `BackgroundColor` component to `TextBundle`. --- ## Changelog * Added a `BackgroundColor` component to `TextBundle`. * Added a helper method `with_background_color` to `TextBundle`. ## Migration Guide `TextBundle` now has a `BackgroundColor` component. Use `TextBundle`'s `background_color` field or the `with_background_color` method to set a background color for text when spawning a text node, in place of manual insertion of a `BackgroundColor` component. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |