From 9852f3058116e84e59f9f8adf3ccddb37b1df44c Mon Sep 17 00:00:00 2001 From: vova-rs Date: Mon, 26 Oct 2026 19:42:11 +0300 Subject: [PATCH] resize rectsngle --- Cargo.toml | 8 ++++++++ src/game_client/mod.rs | 39 +++++++++++++++++++++++++++++++++++++++ src/main.rs | 20 +++++++++++++++++++- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/game_client/mod.rs diff --git a/Cargo.toml b/Cargo.toml index 0737146..8c64a9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,3 +4,11 @@ version = "0.1.0" edition = "2024" [dependencies] +bevy = "0.20" + +[profildev] +opt-level = 1 +debug = true + +[profile.dev.package."*"] +opt-level = 3 diff --git a/src/game_client/mod.rs b/src/game_client/mod.rs new file mode 100644 index 0000000..0efc013 --- /dev/null +++ b/src/game_client/mod.rs @@ -0,0 +1,39 @@ +use bevy::prelude::*; + +pub struct Cli; + +impl Plugin for Cli { + fn build(&self, app: &mut App) { + app.add_systems(Startup, setup_scene); + // app.add_systems(Update, my_system); + } +} + + +fn setup_scene( + mut commands: Commands, +) { + commands.spawn(Camera2d); + + commands.spawn(( + Node { + width: Val::Percent(100.0), + height: Val::Percent(100.0), + justify_content: JustifyContent::Center, + align_items: AlignItems::Center, + ..default() + }, + BackgroundColor(Color::srgb(0.1, 0.1, 0.1)), + children![ + ( + Node { + width: Val::VMin(90.0), + height: Val::VMin(90.0), + aspect_ratio: Some(1.0), + ..default() + }, + BackgroundColor(Color::srgb(0.2, 0.6, 0.8)), + ) + ], + )); +} diff --git a/src/main.rs b/src/main.rs index ff889f6..0dc2d3a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,8 +4,26 @@ use chess_api::*; mod render_bitmask; use render_bitmask::*; +use bevy::prelude::*; + +mod game_client; fn main() { - println!("hell"); + App::new() + .add_plugins(DefaultPlugins.set(WindowPlugin { + primary_window: Some(Window { + title: "local-chess".into(), + resolution: (800, 800).into(), + resizable: true, + ..default() + }), + ..default() + })) + .add_plugins(game_client::Cli) + .add_systems(Startup, hello_world_system) + .run(); } +fn hello_world_system() { + println!("Hello, World!"); +}