My GUI is 2D grid of pixels. I want to create the window in the floor.init();
and then later change the grid color with floor.set_floor_color(&floor_grid);
Could you suggest how can this be implemented, or what creates could I use?
use std::env;
use std::thread;
use std::time::Duration;
mod floor_simulator;
use floor_simulator::Floor;
mod tile;
use tile::Tile;
fn main() {
// Check the code is running locally on the simulator
let run_simulator_locally = env::var("FLOOR_SIMULATOR").is_ok();
if run_simulator_locally {
println!("Floor Simulator");
let floor_grid: Vec<Vec<Tile>> = Vec::new();
let mut floor = Floor::new(11, 17);
floor.init();
floor.set_floor_color(&floor_grid);
} else {
println!("Interactive Floor");
}
}