feat!: "Syntax sugar" for pixels per meter measure

- Added meters function for better readability
- Adjusted tilemap_bundle transform
- Added 2nd floor in setup_world system

BREAKING CHANGE: Removed HALVED_PIXELS_PER_METER const
This commit is contained in:
Alexey 2026-03-24 12:13:08 +03:00
commit 0c0dcec4b8
6 changed files with 51 additions and 27 deletions

View file

@ -16,7 +16,6 @@ mod tests;
pub mod ui;
pub const PIXELS_PER_METER: f32 = 16.0;
pub const HALVED_PIXELS_PER_METER: f32 = PIXELS_PER_METER * 0.5;
pub struct ExpeditionPlugin;
@ -52,6 +51,11 @@ fn insert_entity_name(names: Query<(Entity, &mut Name), Added<Name>>) {
}
}
#[inline(always)]
pub const fn meters(value: f32) -> f32 {
PIXELS_PER_METER * value
}
fn setup_global(mut commands: Commands) {
commands.spawn(camera_bundle());
commands.spawn(ui::UiRoot::new());