feat: re-add board offset logic, fixup text rendering

This commit is contained in:
2025-07-26 15:26:37 -05:00
parent a1d37a1a0b
commit 7a6182cb85
8 changed files with 42 additions and 28 deletions

View File

@@ -11,9 +11,16 @@ pub const BOARD_CELL_SIZE: UVec2 = UVec2::new(28, 31);
pub const SCALE: f32 = 2.6;
/// The offset of the game board from the top-left corner of the window, in cells.
pub const BOARD_OFFSET: UVec2 = UVec2::new(0, 0);
pub const BOARD_CELL_OFFSET: UVec2 = UVec2::new(0, 3);
/// The offset of the game board from the top-left corner of the window, in pixels.
pub const BOARD_PIXEL_OFFSET: UVec2 = UVec2::new(BOARD_CELL_OFFSET.x * CELL_SIZE, BOARD_CELL_OFFSET.y * CELL_SIZE);
/// The size of the game board, in pixels.
pub const BOARD_PIXEL_SIZE: UVec2 = UVec2::new(BOARD_CELL_SIZE.x * CELL_SIZE, BOARD_CELL_SIZE.y * CELL_SIZE);
/// The size of the canvas, in pixels.
pub const CANVAS_SIZE: UVec2 = UVec2::new(
(BOARD_CELL_SIZE.x + BOARD_CELL_OFFSET.x) * CELL_SIZE,
(BOARD_CELL_SIZE.y + BOARD_CELL_OFFSET.y) * CELL_SIZE,
);
/// An enum representing the different types of tiles on the map.
#[derive(Debug, Clone, Copy, PartialEq)]