How to Save Node and Children to PNG

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By marcos.feijoo

Hi Gedis I need your help.

Is it possible to save as PNG a Sprite Node with other Sprites as chldren?

I dont want to save the whole screen as it can be done with:
var image = get_viewport().get_texture().get_data()

Thank you in advance!
May the Force be with you

I don’t quite understand you. Please explain how you want to use that sprite with children saved as a png.

magicalogic | 2021-05-04 20:53

:bust_in_silhouette: Reply From: MagnusS

Your best chance is probably to copy all the nodes into a new viewport and render this viewport via getviewport().gettexture().get_data() as you described above.