Astrabit-ST / Luminol

An RPG Maker XP-VX Ace rewrite, written in Rust with love 💕
https://luminol.dev/
GNU General Public License v3.0
95 stars 11 forks source link

Implement saving map as image file #131

Closed white-axe closed 2 weeks ago

white-axe commented 2 weeks ago

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