Description
This pull request adds a "Save map preview" button to the map editor that saves the current state of the map, with all currently visible layers, as a PNG file.
The implementation is in the save_as_image function in crates/components/src/map_view.rs.
Testing
On an arbitrary map, the button should be able to correctly render all visible map layers and events, with layer darkening if it's enabled. Also it should be able to render the grid and collision layers if they're enabled. It should also be able to render maps that are larger than the maximum texture dimensions allowed by wgpu (it does this by breaking the map into large tiles and rendering them individually before combining them together).
Description This pull request adds a "Save map preview" button to the map editor that saves the current state of the map, with all currently visible layers, as a PNG file.
The implementation is in the
save_as_image
function in crates/components/src/map_view.rs.Testing On an arbitrary map, the button should be able to correctly render all visible map layers and events, with layer darkening if it's enabled. Also it should be able to render the grid and collision layers if they're enabled. It should also be able to render maps that are larger than the maximum texture dimensions allowed by wgpu (it does this by breaking the map into large tiles and rendering them individually before combining them together).
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown -Z build-std=std,panic_abort
cargo build --release
trunk build --release