Trouble saving game to an image and avoiding culling

So I’m creating a map editor in Phaser, and I want to allow the user to download a png of the map they’ve created.

I’ve been experimenting with game.renderer.snapshotArea, but the issue I’m running into is the map can be fairly large, and if the map extends out of the current viewport, the objects are being culled and therefore not rendered. The render also changes based on camera zoom, but ideally this would be normalized.

I can’t seem to find options to change the cull settings. camera.disableCull doesn’t work (and the docs seem to suggest this isn’t what it’s meant to be used for, anyhow). And zooming out the camera seems like a non starter, because the resulting image would also be zoomed out, whereas I need it true to size.

Is there another option beside snapshotArea to explore.

:wave:

The renderer snapshots can’t be larger than the game canvas.

I think you can do this by drawing onto a large Render Texture and snapshotting that.

1 Like

Thanks! As a hacky workaround, I got it working by resizing the game canvas, and setting it back after the render, but it does result in a rather awkward moment rendering the game.

I’ll consider trying it with a RenderTexture, but it will take some considerable refactor to do so.