Skip to content

Fixing text sizes for examples #15190

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
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions examples/2d/text2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let font = asset_server.load("fonts/FiraSans-Bold.ttf");
let text_style = TextStyle {
font: font.clone(),
font_size: 60.0,
font_size: 50.0,
..default()
};
let text_justification = JustifyText::Center;
Expand Down Expand Up @@ -72,7 +72,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
// Demonstrate text wrapping
let slightly_smaller_text_style = TextStyle {
font,
font_size: 42.0,
font_size: 35.0,
..default()
};
let box_size = Vec2::new(300.0, 200.0);
Expand Down
4 changes: 2 additions & 2 deletions examples/2d/texture_atlas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn setup(
// padding label text style
let text_style: TextStyle = TextStyle {
font: font.clone(),
font_size: 50.0,
font_size: 42.0,
..default()
};

Expand Down Expand Up @@ -172,7 +172,7 @@ fn setup(
// label text style
let sampling_label_style = TextStyle {
font,
font_size: 30.0,
font_size: 25.0,
..default()
};

Expand Down
2 changes: 1 addition & 1 deletion examples/3d/color_grading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ fn add_text<'a>(
label,
TextStyle {
font: font.clone(),
font_size: 18.0,
font_size: 15.0,
color,
},
))
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/load_gltf_extras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
TextBundle::from_section(
"",
TextStyle {
font_size: 18.,
font_size: 15.,
..default()
},
)
Expand Down
6 changes: 3 additions & 3 deletions examples/3d/pbr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn setup(
TextBundle::from_section(
"Perceptual Roughness",
TextStyle {
font_size: 36.0,
font_size: 30.0,
..default()
},
)
Expand All @@ -82,7 +82,7 @@ fn setup(
text: Text::from_section(
"Metallic",
TextStyle {
font_size: 36.0,
font_size: 30.0,
..default()
},
),
Expand All @@ -103,7 +103,7 @@ fn setup(
TextBundle::from_section(
"Loading Environment Map...",
TextStyle {
font_size: 36.0,
font_size: 30.0,
..default()
},
)
Expand Down
2 changes: 1 addition & 1 deletion examples/asset/multi_asset_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ fn setup_ui(mut commands: Commands) {
sections: vec![TextSection {
value: "Loading...".to_owned(),
style: TextStyle {
font_size: 64.0,
font_size: 53.0,
color: Color::BLACK,
..Default::default()
},
Expand Down
5 changes: 1 addition & 4 deletions examples/camera/first_person_view_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,7 @@ fn spawn_text(mut commands: Commands) {
"Press arrow up to decrease the FOV of the world model.\n",
"Press arrow down to increase the FOV of the world model."
),
TextStyle {
font_size: 25.0,
..default()
},
TextStyle::default(),
));
});
}
Expand Down
7 changes: 2 additions & 5 deletions examples/dev_tools/fps_overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn main() {
config: FpsOverlayConfig {
text_config: TextStyle {
// Here we define size of our overlay
font_size: 50.0,
font_size: 42.0,
// We can also change color of the overlay
color: Color::srgb(0.0, 1.0, 0.0),
// If we want, we can use a custom font
Expand Down Expand Up @@ -49,10 +49,7 @@ fn setup(mut commands: Commands) {
"Press 1 to change color of the overlay.\n",
"Press 2 to change size of the overlay."
),
TextStyle {
font_size: 25.0,
..default()
},
TextStyle::default(),
));
});
}
Expand Down
4 changes: 2 additions & 2 deletions examples/games/alien_cake_addict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>, mut game: ResMu
TextBundle::from_section(
"Score:",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.5, 0.5, 1.0),
..default()
},
Expand Down Expand Up @@ -414,7 +414,7 @@ fn display_score(mut commands: Commands, game: Res<Game>) {
parent.spawn(TextBundle::from_section(
format!("Cake eaten: {}", game.cake_eaten),
TextStyle {
font_size: 80.0,
font_size: 67.0,
color: Color::srgb(0.5, 0.5, 1.0),
..default()
},
Expand Down
2 changes: 1 addition & 1 deletion examples/games/breakout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const GAP_BETWEEN_BRICKS: f32 = 5.0;
const GAP_BETWEEN_BRICKS_AND_CEILING: f32 = 20.0;
const GAP_BETWEEN_BRICKS_AND_SIDES: f32 = 20.0;

const SCOREBOARD_FONT_SIZE: f32 = 40.0;
const SCOREBOARD_FONT_SIZE: f32 = 33.0;
const SCOREBOARD_TEXT_PADDING: Val = Val::Px(5.0);

const BACKGROUND_COLOR: Color = Color::srgb(0.9, 0.9, 0.9);
Expand Down
2 changes: 1 addition & 1 deletion examples/games/desk_toy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn setup(
let font = asset_server.load("fonts/FiraSans-Bold.ttf");
let text_style = TextStyle {
font: font.clone(),
font_size: 30.0,
font_size: 25.0,
..default()
};
commands.spawn((
Expand Down
18 changes: 9 additions & 9 deletions examples/games/game_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ mod game {
TextBundle::from_section(
"Will be back to the menu shortly...",
TextStyle {
font_size: 80.0,
font_size: 67.0,
color: TEXT_COLOR,
..default()
},
Expand All @@ -194,23 +194,23 @@ mod game {
TextSection::new(
format!("quality: {:?}", *display_quality),
TextStyle {
font_size: 60.0,
font_size: 50.0,
color: BLUE.into(),
..default()
},
),
TextSection::new(
" - ",
TextStyle {
font_size: 60.0,
font_size: 50.0,
color: TEXT_COLOR,
..default()
},
),
TextSection::new(
format!("volume: {:?}", *volume),
TextStyle {
font_size: 60.0,
font_size: 50.0,
color: LIME.into(),
..default()
},
Expand Down Expand Up @@ -401,7 +401,7 @@ mod menu {
..default()
};
let button_text_style = TextStyle {
font_size: 40.0,
font_size: 33.0,
color: TEXT_COLOR,
..default()
};
Expand Down Expand Up @@ -437,7 +437,7 @@ mod menu {
TextBundle::from_section(
"Bevy Game Menu UI",
TextStyle {
font_size: 80.0,
font_size: 67.0,
color: TEXT_COLOR,
..default()
},
Expand Down Expand Up @@ -527,7 +527,7 @@ mod menu {
};

let button_text_style = TextStyle {
font_size: 40.0,
font_size: 33.0,
color: TEXT_COLOR,
..default()
};
Expand Down Expand Up @@ -593,7 +593,7 @@ mod menu {
..default()
};
let button_text_style = TextStyle {
font_size: 40.0,
font_size: 33.0,
color: TEXT_COLOR,
..default()
};
Expand Down Expand Up @@ -697,7 +697,7 @@ mod menu {
..default()
};
let button_text_style = TextStyle {
font_size: 40.0,
font_size: 33.0,
color: TEXT_COLOR,
..default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/games/loading_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn setup(mut commands: Commands) {

// Spawns the UI that will show the user prompts.
let text_style = TextStyle {
font_size: 50.0,
font_size: 42.0,
..default()
};
commands
Expand Down Expand Up @@ -266,7 +266,7 @@ struct LoadingScreen;
// Spawns the necessary components for the loading screen.
fn load_loading_screen(mut commands: Commands) {
let text_style = TextStyle {
font_size: 80.0,
font_size: 67.0,
..default()
};

Expand Down
2 changes: 1 addition & 1 deletion examples/games/stepping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ fn build_stepping_hint(mut commands: Commands) {
commands.spawn((TextBundle::from_sections([TextSection::new(
hint_text,
TextStyle {
font_size: 18.0,
font_size: 15.0,
color: FONT_COLOR,
..default()
},
Expand Down
2 changes: 1 addition & 1 deletion examples/scene/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ fn infotext_system(mut commands: Commands) {
TextBundle::from_section(
"Nothing to see in this window! Check the console output!",
TextStyle {
font_size: 50.0,
font_size: 42.0,
..default()
},
)
Expand Down
20 changes: 10 additions & 10 deletions examples/state/computed_states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ mod ui {
parent.spawn(TextBundle::from_section(
"Play",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.9, 0.9, 0.9),
..default()
},
Expand Down Expand Up @@ -403,7 +403,7 @@ mod ui {
parent.spawn(TextBundle::from_section(
"Tutorial",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.9, 0.9, 0.9),
..default()
},
Expand Down Expand Up @@ -504,7 +504,7 @@ mod ui {
parent.spawn(TextBundle::from_section(
"Paused",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.9, 0.9, 0.9),
..default()
},
Expand Down Expand Up @@ -536,7 +536,7 @@ mod ui {
parent.spawn(TextBundle::from_section(
"TURBO MODE",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.9, 0.3, 0.1),
..default()
},
Expand Down Expand Up @@ -578,15 +578,15 @@ mod ui {
parent.spawn(TextBundle::from_section(
"Move the bevy logo with the arrow keys",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.3, 0.3, 0.7),
..default()
},
));
parent.spawn(TextBundle::from_section(
"Press T to enter TURBO MODE",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.3, 0.3, 0.7),
..default()
},
Expand All @@ -595,7 +595,7 @@ mod ui {
parent.spawn(TextBundle::from_section(
"Press SPACE to pause",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.3, 0.3, 0.7),
..default()
},
Expand All @@ -604,7 +604,7 @@ mod ui {
parent.spawn(TextBundle::from_section(
"Press ESCAPE to return to the menu",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.3, 0.3, 0.7),
..default()
},
Expand Down Expand Up @@ -635,7 +635,7 @@ mod ui {
parent.spawn(TextBundle::from_section(
"Press SPACE to resume",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.3, 0.3, 0.7),
..default()
},
Expand All @@ -644,7 +644,7 @@ mod ui {
parent.spawn(TextBundle::from_section(
"Press ESCAPE to return to the menu",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.3, 0.3, 0.7),
..default()
},
Expand Down
2 changes: 1 addition & 1 deletion examples/state/custom_transitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ fn setup_menu(mut commands: Commands) {
parent.spawn(TextBundle::from_section(
"Play",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.9, 0.9, 0.9),
..default()
},
Expand Down
2 changes: 1 addition & 1 deletion examples/state/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fn setup_menu(mut commands: Commands) {
parent.spawn(TextBundle::from_section(
"Play",
TextStyle {
font_size: 40.0,
font_size: 33.0,
color: Color::srgb(0.9, 0.9, 0.9),
..default()
},
Expand Down
Loading