How to get a render target texture and save as PNG?

#1

I need to implement a share feature for the player’s game result. To the social network.

I draw player’s score list like:

render.enable_render_target(self.share_render_target)
render.clear({[render.BUFFER_COLOR_BIT] = self.clear_color, [render.BUFFER_DEPTH_BIT] = 1})
render.draw(self.score_list_gui_pred)
render.disable_render_target(self.share_render_target)

And then I can’t understand how to get a texture buffer or something like this from the render target.
In order to then convert it to png.

0 Likes

#2

Perhaps this extension from the asset library can be of use:

2 Likes

#3

I was advised extension-screenrecorder. Should help.

1 Like