From fb607b1bd1ddb70802d5c39893c8f2612fadd45d Mon Sep 17 00:00:00 2001 From: Derick M <58572875+TurtIeSocks@users.noreply.github.com> Date: Sat, 9 Nov 2024 18:50:14 -0500 Subject: [PATCH] UI/text Example - Clarity Improvements (#16302) # Objective - Fixes #16292 ## Solution - Renames the `ColorText` marker to `AnimatedText`, which is more distinct from the `TextColor` Bevy component. - Changes the comment language from `A unit struct` to `Marker struct` for better consistency with other Bevy docs. ## Testing - Locally, example still runs just fine --- examples/ui/text.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/ui/text.rs b/examples/ui/text.rs index 18ab488789718..354a04a23d65a 100644 --- a/examples/ui/text.rs +++ b/examples/ui/text.rs @@ -17,13 +17,13 @@ fn main() { .run(); } -// A unit struct to help identify the FPS UI component, since there may be many Text components +// Marker struct to help identify the FPS UI component, since there may be many Text components #[derive(Component)] struct FpsText; -// A unit struct to help identify the color-changing Text component +// Marker struct to help identify the color-changing Text component #[derive(Component)] -struct ColorText; +struct AnimatedText; fn setup(mut commands: Commands, asset_server: Res) { // UI camera @@ -47,7 +47,7 @@ fn setup(mut commands: Commands, asset_server: Res) { right: Val::Px(5.0), ..default() }, - ColorText, + AnimatedText, )); // Text with multiple sections @@ -116,7 +116,7 @@ fn setup(mut commands: Commands, asset_server: Res) { )); } -fn text_color_system(time: Res