switch to default font

This commit is contained in:
Aevyrie 2023-07-18 00:07:35 -07:00
parent a51174b299
commit c0113e51e3
5 changed files with 11 additions and 12 deletions

View File

@ -15,7 +15,7 @@ bevy = { version = "0.11", default_features = false }
[dev-dependencies]
bevy = "0.11"
bevy_framepace = "0.13"
bevy_framepace = { version = "0.13", default-features = false }
[features]
default = ["debug"]

Binary file not shown.

View File

@ -88,14 +88,14 @@ fn setup(
#[derive(Component, Reflect)]
pub struct BigSpaceDebugText;
fn ui_setup(mut commands: Commands, asset_server: Res<AssetServer>) {
fn ui_setup(mut commands: Commands) {
commands.spawn((
TextBundle::from_section(
"",
TextStyle {
font: asset_server.load("fonts/FiraMono-Regular.ttf"),
font_size: 18.0,
color: Color::WHITE,
..default()
},
)
.with_text_alignment(TextAlignment::Left)

View File

@ -78,8 +78,7 @@ fn rotator_system(time: Res<Time>, mut query: Query<&mut Transform, With<Rotator
}
}
fn setup_ui(mut commands: Commands, asset_server: Res<AssetServer>) {
let font = asset_server.load("fonts/FiraMono-Regular.ttf");
fn setup_ui(mut commands: Commands) {
commands.spawn(TextBundle {
style: Style {
align_self: AlignSelf::FlexStart,
@ -90,9 +89,9 @@ fn setup_ui(mut commands: Commands, asset_server: Res<AssetServer>) {
sections: vec![TextSection {
value: "hello: ".to_string(),
style: TextStyle {
font,
font_size: 30.0,
color: Color::WHITE,
..default()
},
}],
..Default::default()

View File

@ -41,13 +41,13 @@ pub fn update_debug_bounds<P: GridPrecision>(
for (cell, has_origin) in cells.values() {
let cell = cell - origin_cell;
let scale = Vec3::splat(settings.grid_edge_length * 0.999);
let translation = settings.grid_position(&cell, &Transform::IDENTITY);
gizmos.cuboid(
Transform::from_translation(settings.grid_position(&cell, &Transform::IDENTITY))
.with_scale(Vec3::splat(settings.grid_edge_length)),
if *has_origin {
Color::BLUE
} else {
Color::GREEN
Transform::from_translation(translation).with_scale(scale),
match *has_origin {
true => Color::BLUE,
false => Color::GREEN,
},
)
}