mirror of
https://github.com/eliasstepanik/big_space_with_trim.git
synced 2026-01-11 18:38:28 +00:00
switch to default font
This commit is contained in:
parent
a51174b299
commit
c0113e51e3
@ -15,7 +15,7 @@ bevy = { version = "0.11", default_features = false }
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
bevy = "0.11"
|
bevy = "0.11"
|
||||||
bevy_framepace = "0.13"
|
bevy_framepace = { version = "0.13", default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["debug"]
|
default = ["debug"]
|
||||||
|
|||||||
Binary file not shown.
@ -88,14 +88,14 @@ fn setup(
|
|||||||
#[derive(Component, Reflect)]
|
#[derive(Component, Reflect)]
|
||||||
pub struct BigSpaceDebugText;
|
pub struct BigSpaceDebugText;
|
||||||
|
|
||||||
fn ui_setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
fn ui_setup(mut commands: Commands) {
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
TextBundle::from_section(
|
TextBundle::from_section(
|
||||||
"",
|
"",
|
||||||
TextStyle {
|
TextStyle {
|
||||||
font: asset_server.load("fonts/FiraMono-Regular.ttf"),
|
|
||||||
font_size: 18.0,
|
font_size: 18.0,
|
||||||
color: Color::WHITE,
|
color: Color::WHITE,
|
||||||
|
..default()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.with_text_alignment(TextAlignment::Left)
|
.with_text_alignment(TextAlignment::Left)
|
||||||
|
|||||||
@ -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>) {
|
fn setup_ui(mut commands: Commands) {
|
||||||
let font = asset_server.load("fonts/FiraMono-Regular.ttf");
|
|
||||||
commands.spawn(TextBundle {
|
commands.spawn(TextBundle {
|
||||||
style: Style {
|
style: Style {
|
||||||
align_self: AlignSelf::FlexStart,
|
align_self: AlignSelf::FlexStart,
|
||||||
@ -90,9 +89,9 @@ fn setup_ui(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
sections: vec![TextSection {
|
sections: vec![TextSection {
|
||||||
value: "hello: ".to_string(),
|
value: "hello: ".to_string(),
|
||||||
style: TextStyle {
|
style: TextStyle {
|
||||||
font,
|
|
||||||
font_size: 30.0,
|
font_size: 30.0,
|
||||||
color: Color::WHITE,
|
color: Color::WHITE,
|
||||||
|
..default()
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|||||||
12
src/debug.rs
12
src/debug.rs
@ -41,13 +41,13 @@ pub fn update_debug_bounds<P: GridPrecision>(
|
|||||||
|
|
||||||
for (cell, has_origin) in cells.values() {
|
for (cell, has_origin) in cells.values() {
|
||||||
let cell = cell - origin_cell;
|
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(
|
gizmos.cuboid(
|
||||||
Transform::from_translation(settings.grid_position(&cell, &Transform::IDENTITY))
|
Transform::from_translation(translation).with_scale(scale),
|
||||||
.with_scale(Vec3::splat(settings.grid_edge_length)),
|
match *has_origin {
|
||||||
if *has_origin {
|
true => Color::BLUE,
|
||||||
Color::BLUE
|
false => Color::GREEN,
|
||||||
} else {
|
|
||||||
Color::GREEN
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user