From 4d4f28f4d0e93541e92277f44451aacdc23b8227 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Tue, 18 Aug 2026 00:21:44 -0700 Subject: MVP of marching squares --- src/renderer/ui.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/renderer') diff --git a/src/renderer/ui.rs b/src/renderer/ui.rs index a1ac31f..56bf278 100644 --- a/src/renderer/ui.rs +++ b/src/renderer/ui.rs @@ -100,18 +100,20 @@ pub fn draw_egui<'a>( ui.add(egui::Slider::new(&mut camera.zoom, 0.0..=10.0).text("Zoom")); ui.heading("Input"); - input.last_mouse_pos_on_screen.map(|p| { - ui.label(format!( - "Mouse: x,y=({x}, {y}), lmb_pressed={lmb}", - x = p.0, - y = p.1, - lmb = input.is_lmb_pressed - )) - }); + input + .last_mouse_world_pos + .map(|p| ui.label(format!("Mouse (world): x,y=({x}, {y})", x = p.0, y = p.1,))); + + input + .last_mouse_chunk_pos + .map(|p| ui.label(format!("Mouse (chunk): x,y=({x}, {y})", x = p.0, y = p.1,))); + + input + .last_mouse_local_pos + .map(|p| ui.label(format!("Mouse (local): x,y=({x}, {y})", x = p.0, y = p.1,))); if let Some((x, y)) = input.last_mouse_world_pos { ui.heading("Entity"); - ui.label(format!("x,y=({x}, {y})")); if let Some(cell) = world.get_cell_from_game_position(x.round() as i32, y.round() as i32) { let material = cell.material.def(); let cell_label = ui.label( -- cgit v1.3.1