How to create screenshot? (DEF-2059)

How to create a screenshot in Defold?

1 Like

I believe that Defold has a built-in screen recorder, but for a screenshot I think you’d just use your OS’s way of capturing the screen. What OS are you running?

I’m interested in generic solution (iOS, Android, Windows…). I would like to create a screenshot (png/jpeg format) in my game and send the screenshot to photo application.

1 Like

Oh, that’s a more difficult case. You might be able to modify your render script to render the screen into a buffer and convert that into a .png, but hopefully there’s an easier way. @sicher, is there a built-in screenshot function? I looked around in the documentation and wasn’t able to find anything on one.

No, unfortunately there is not. I’ll check the backlog if we have that planned.

1 Like

It would be useful able to make screenshot of current state of game. For example to sharing game result in social network.

@britzl has made a screenshot native extension. Although I think it’s only been tested on iOS or Android, it should be fairly easy to port for other platforms, since it relies on glReadPixels()

2 Likes

I need for the poster-reminder: “before ask anything check @britzl github” :slight_smile:

4 Likes

It works on Android and OSX. It doesn’t work on iOS (black screenshots). Haven’t tried on any other platform. I’ll send some Defold swag to whoever fixes the extension on iOS.

3 Likes