24 lines
583 B
Rust
24 lines
583 B
Rust
use crate::grid;
|
|
use bevy::prelude::*;
|
|
|
|
pub struct CanvasPlugin;
|
|
|
|
impl Plugin for CanvasPlugin {
|
|
fn build(&self, app: &mut App) {
|
|
app.add_startup_system(spawn_background);
|
|
}
|
|
}
|
|
|
|
fn spawn_background(mut commands: Commands) {
|
|
commands
|
|
.spawn_bundle(SpriteBundle {
|
|
sprite: Sprite {
|
|
color: Color::DARK_GRAY,
|
|
custom_size: Some(Vec2::splat(grid::SEGMENT_SIZE * grid::SIZE as f32)),
|
|
..Default::default()
|
|
},
|
|
..Default::default()
|
|
})
|
|
.insert(Name::new("Canvas"));
|
|
}
|