diff --git a/resources/PressStart2P-Regular.ttf b/resources/PressStart2P-Regular.ttf new file mode 100644 index 0000000..2442aff Binary files /dev/null and b/resources/PressStart2P-Regular.ttf differ diff --git a/src/consts/mod.rs b/src/consts/mod.rs index 9283b56..dad4214 100644 --- a/src/consts/mod.rs +++ b/src/consts/mod.rs @@ -12,5 +12,6 @@ pub mod prelude { } pub const TILESIZE: f32 = 16.0; +pub const FONTSIZE: f32 = 12.0; pub const DISPLAYWIDTH: u32 = 100; pub const DISPLAYHEIGHT: u32 = 56; diff --git a/src/gui/cheat_menu.rs b/src/gui/cheat_menu.rs index f01ea70..5c3df6f 100644 --- a/src/gui/cheat_menu.rs +++ b/src/gui/cheat_menu.rs @@ -3,7 +3,7 @@ use bracket_lib::prelude::*; use notan::prelude::*; use notan::draw::DrawTextSection; use std::collections::HashMap; -use crate::consts::TILESIZE; +use crate::consts::{ TILESIZE, FONTSIZE }; #[derive(PartialEq, Copy, Clone)] pub enum CheatMenuResult { @@ -59,7 +59,7 @@ pub fn draw_cheat_menu( m - MAGIC MAP REVEAL g - GOD MODE"#; draw.text(&font, DEBUG_MENU) - .position(3.0 + (offsets.x as f32) * TILESIZE, 3.0 + (offsets.y as f32) * TILESIZE) + .position((1.0 + (offsets.x as f32)) * TILESIZE, (1.0 + (offsets.y as f32)) * TILESIZE) .color(Color::RED) - .size(TILESIZE); + .size(FONTSIZE); } diff --git a/src/main.rs b/src/main.rs index c3988bb..47602a5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ use specs::prelude::*; use specs::saveload::{ SimpleMarker, SimpleMarkerAllocator }; use bracket_lib::prelude::*; use std::collections::HashMap; -use crate::consts::{ DISPLAYHEIGHT, DISPLAYWIDTH, TILESIZE }; +use crate::consts::{ DISPLAYHEIGHT, DISPLAYWIDTH, TILESIZE, FONTSIZE }; #[notan_main] fn main() -> Result<(), String> { @@ -30,7 +30,7 @@ fn setup(gfx: &mut Graphics) -> State { .unwrap(); let data = include_bytes!("../resources/td.json"); let atlas = create_textures_from_atlas(data, &texture).unwrap(); - let font = gfx.create_font(include_bytes!("../resources/Ubuntu-B.ttf")).unwrap(); + let font = gfx.create_font(include_bytes!("../resources/PressStart2P-Regular.ttf")).unwrap(); let mut gs = State { ecs: World::new(), base_texture: texture, @@ -436,7 +436,7 @@ fn draw(app: &mut App, gfx: &mut Graphics, gs: &mut State) { RunState::Farlook { x, y } => { draw.text(&gs.font, "RunState::Farlook") .position(((x + 2) as f32) * TILESIZE, (y as f32) * TILESIZE) - .size(TILESIZE); + .size(FONTSIZE); crate::gui::draw_farlook(x, y, &mut draw, &gs.atlas); //draw_tooltips(&gs.ecs, ctx, Some((x, y))); TODO: Put this in draw loop }