How to take high-resolution screenshots in Defold?

Hi everyone!

I need to make nice screenshots of my game, but taking photos of the monitor is not great.

Is there any built-in way or community library/extension in Defold that can:

  • take a screenshot with one button (for example, on a key press), and

  • save it in good/high resolution (as long as the game itself is rendered in a good resolution)?

Thanks, this was actually the first thing I tried to use. :slightly_smiling_face:

As far as I understand, defold-screenshot just reads the pixels directly from the screen / game window, so the screenshot resolution is the same as the window resolution.

What I’m looking for is a way to grab a higher-resolution image than the current window. For example, imagine I have a 1080×1920 monitor but I’m playing an 8K video – I’d like to get something like an “8K frame”, not just a 1080×1920 screenshot. I’m wondering if something similar is possible in Defold: render the game off-screen in a larger resolution (4K/8K) and save that as an image.

Is this technically possible with Defold right now, maybe via a custom render target or some trick with the render script? Any hints or examples would be super helpful.

Whoa! That’s a little more unusual. I’d also be interested to see if this is possible.

A common way is to divide the screen in to rectangular areas, e.g like 2x2 or 4x4 tiles.
For each tile, set a projection matrix that matches that area, and render.
This produces an image for that tile.
At the end, stitch these images together into a final, large image.

3 Likes