Skip to content

Text background colors #18892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
May 4, 2025
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b6bc668
Added "text_background_colors" example
ickshonpe Apr 20, 2025
53ae45b
Added TextBackgroundColor component
ickshonpe Apr 21, 2025
6e156e8
Collect rects in text pipeline
ickshonpe Apr 21, 2025
56edf1c
Added extraction system
ickshonpe Apr 21, 2025
4f5b7d5
expanded example
ickshonpe Apr 21, 2025
994f5e9
cleaned up example
ickshonpe Apr 21, 2025
30466ef
Renamed `span_rects` to `section_rects`
ickshonpe Apr 21, 2025
cda4a4b
use first() instead of get(0)
ickshonpe Apr 21, 2025
e0d65e9
Use a monospaced font with the example
ickshonpe Apr 21, 2025
a2aacd5
Removed unused parameter
ickshonpe Apr 21, 2025
453b83a
Added `register_type` for `TextBackgroundColor`
ickshonpe Apr 22, 2025
dc4c7e2
Update crates/bevy_text/src/text.rs
ickshonpe Apr 22, 2025
45ec06f
Merge branch 'main' into text-background-colors
ickshonpe Apr 22, 2025
2775707
Update crates/bevy_ui/src/render/mod.rs
ickshonpe Apr 23, 2025
f97745d
set start of sections to `end.max(glyph.x)`
ickshonpe Apr 23, 2025
8534a07
Consolidate background and glyph updates
ickshonpe Apr 26, 2025
5710c9f
Update glyphs and backgrounds together in same inner loop.
ickshonpe Apr 26, 2025
486e672
Added draft release note.
ickshonpe Apr 26, 2025
48311e5
Merge branch 'main' into text-background-colors
ickshonpe Apr 26, 2025
f88334a
cargo fmt --all
ickshonpe Apr 26, 2025
42607e4
Merge branch 'main' into text-background-colors
ickshonpe Apr 27, 2025
accc98e
removed unnecessary cast
ickshonpe Apr 27, 2025
0c45ca0
Fix for markdown lint
ickshonpe Apr 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleaned up example
  • Loading branch information
ickshonpe committed Apr 21, 2025
commit 994f5e9fcdf0eefba16e17df92b0d300b50f3ddf
8 changes: 0 additions & 8 deletions examples/ui/text_background_colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use bevy::{
color::palettes::css::{BLUE, GREEN, PURPLE, RED, YELLOW},
prelude::*,
text::TextBackgroundColor,
};

fn main() {
Expand Down Expand Up @@ -31,13 +30,6 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
"o", "r", "s", "!",
];

for (i, section_str) in message_text.iter().enumerate() {
commands.spawn((
TextSpan::new(*section_str),
BackgroundColor(PALETTE[i % PALETTE.len()]),
));
}

commands
.spawn(Node {
width: Val::Percent(100.),
Expand Down