From 83d3ecf43632da64e28e7eec58ff5a95f947d32b Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Mon, 27 Nov 2023 12:59:14 +0000 Subject: [PATCH] feat: some asset server improvements Former-commit-id: 42f28f6884ba638fc55260d711c0c2b9eeb0af33 --- src/main.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index fcd3527..d387959 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 + server: Res, + mut commands: Commands ) { let bold_font: Handle = server.load("fonts/iosevka-comfy-bold.ttf"); let regular_font: Handle = 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() + )}; }