This commit is contained in:
Crispy 2025-04-23 21:47:34 +02:00
parent 324d16cfc2
commit 0b2a3991ed
6 changed files with 29 additions and 29 deletions

View file

@ -39,7 +39,6 @@ async fn main() {
// set_window_min_size(640, 480);
set_mouse_cursor(miniquad::CursorIcon::Crosshair);
let mut game = Game::new().await;
game.run().await
}
@ -223,7 +222,13 @@ impl Game {
.get(self.selected_level.0)
.and_then(|c| c.levels.get(self.selected_level.1))
{
draw_text(level.name(), level_list_width + 10., 10., 40., colors::SKYBLUE);
draw_text(
level.name(),
level_list_width + 10.,
10.,
40.,
colors::SKYBLUE,
);
draw_text(level.id(), level_list_width + 10., 50., 10., colors::GRAY);
let mut y = 70.;

View file

@ -285,13 +285,7 @@ impl Grid {
out
}
pub fn draw(
&self,
textures: &Textures,
offset: Vec2,
scale: f32,
power_directions: bool,
) {
pub fn draw(&self, textures: &Textures, offset: Vec2, scale: f32, power_directions: bool) {
let tile_size = (TILE_TEXTURE_SIZE * scale) as i32;
let start_x = (-offset.x as i32) / tile_size - 1;
@ -321,7 +315,13 @@ impl Grid {
}
}
} else {
draw_rectangle(px, py, tile_size as _, tile_size as _, Color::from_rgba(0, 0, 0, 80));
draw_rectangle(
px,
py,
tile_size as _,
tile_size as _,
Color::from_rgba(0, 0, 0, 80),
);
}
}
}

View file

@ -32,11 +32,7 @@ pub fn userdata_dir() -> PathBuf {
}
pub fn draw_rectangle_rec(bounds: Rect, color: Color) {
draw_rectangle(
bounds.x,
bounds.y,
bounds.w,
bounds.h,color);
draw_rectangle(bounds.x, bounds.y, bounds.w, bounds.h, color);
}
pub fn draw_scaled_texture_c(texture: &Texture2D, x: f32, y: f32, scale: f32, color: Color) {
@ -47,7 +43,6 @@ pub fn draw_scaled_texture_c(texture: &Texture2D, x: f32, y: f32, scale: f32, co
draw_texture_ex(texture, x, y, color, params);
}
pub fn draw_scaled_texture(texture: &Texture2D, x: f32, y: f32, scale: f32) {
let params = DrawTextureParams {
dest_size: Some(Vec2::new(texture.width() * scale, texture.height() * scale)),