veloren/world/examples/site.rs

29 lines
812 B
Rust
Raw Normal View History

2021-02-04 12:47:46 +00:00
use structopt::StructOpt;
use svg_fmt::*;
use veloren_world::site2::test_site;
2020-12-26 15:53:06 +00:00
fn main() {
2021-02-04 12:47:46 +00:00
let site = test_site();
let size = site.bounds().size();
println!("{}", BeginSvg { w: size.w as f32, h: size.h as f32 });
for plot in site.plots() {
let bounds = plot.find_bounds();
println!("{}", Rectangle {
x: bounds.min.x as f32,
y: bounds.min.y as f32,
w: bounds.size().w as f32,
h: bounds.size().h as f32,
style: Style {
fill: Fill::Color(Color { r: 50, g: 50, b: 50 }),
stroke: Stroke::Color(Color { r: 0, g: 0, b: 0 }, 1.0),
opacity: 1.0,
stroke_opacity: 1.0,
},
border_radius: 0.0,
});
}
println!("{}", EndSvg);
2020-12-26 15:53:06 +00:00
}