bevy/crates/bevy_ui/src
ickshonpe c4f0de52eb Add a BackgroundColor component to TextBundle (#7596)
# 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.
2023-02-20 22:42:46 +00:00
..
flex The size field of CalculatedSize should not be a Size (#7641) 2023-02-13 18:20:29 +00:00
render Initial tonemapping options (#7594) 2023-02-19 20:38:13 +00:00
widget Changes in the size of a text node should trigger recomputation of its text (#7674) 2023-02-14 14:46:28 +00:00
camera_config.rs Extract component derive (#7399) 2023-01-30 18:12:16 +00:00
focus.rs expose cursor position with scale (#7297) 2023-01-20 14:25:24 +00:00
geometry.rs Add doc tests for the Size constructor functions (#7658) 2023-02-13 18:20:34 +00:00
lib.rs Fix Window feedback loop between the OS and Bevy (#7517) 2023-02-07 14:18:13 +00:00
node_bundles.rs Add a BackgroundColor component to TextBundle (#7596) 2023-02-20 22:42:46 +00:00
stack.rs Rename schedule v3 to schedule (#7519) 2023-02-06 18:44:40 +00:00
ui_node.rs Improve the documentation for flex-basis (#7685) 2023-02-15 13:58:01 +00:00
update.rs Add z-index support with a predictable UI stack (#5877) 2022-11-02 22:06:04 +00:00