feat: some asset server improvements

Former-commit-id: 42f28f6884ba638fc55260d711c0c2b9eeb0af33
This commit is contained in:
Muhammad Nauman Raza 2023-11-27 12:59:14 +00:00
parent 162a621910
commit 0e11ba0b61
Signed by: devraza
GPG key ID: 91EAD6081011574B

View file

@ -1,4 +1,9 @@
use bevy::prelude::*;
use bevy::{
core_pipeline::{
tonemapping::Tonemapping,
},
prelude::*,
};
use std::collections::HashMap;
use lazy_static::lazy_static;
@ -37,13 +42,15 @@ fn setup(mut commands: Commands) {
hdr: true,
..default()
},
tonemapping: Tonemapping::TonyMcMapface,
..default()
}
);
}
fn render_ui(
server: Res<AssetServer>
server: Res<AssetServer>,
mut commands: Commands
) {
let bold_font: Handle<Font> = server.load("fonts/iosevka-comfy-bold.ttf");
let regular_font: Handle<Font> = server.load("fonts/iosevka-comfy-regular.ttf");
@ -53,4 +60,11 @@ fn render_ui(
font_size: 60.0,
color: HYPERNOVA.get("WHITE").copied().unwrap(),
};
let text_alignment = TextAlignment::Center;
commands.spawn((
Text2dBundle {
text: Text::from_section("translation", text_style.clone())
.with_alignment(text_alignment),
..default()
)};
}