0 votes

Hello, I have a scene composed of several Node2Ds. Each of them are parent of several Sprites. The goal of my scene is to add variety by randomly showing a Sprite for each Node2D, and hiding the others.
Here is an example :
Here is an example

I would like to save the result as a texture, to repeat in a Polygon2D from my main scene.
However, I don't want to show the scene, then I cannot use get_viewport().get_screen_capture().

Do you have any idea on how to save the result as a texture ?

If I can't figure out a way, I will launch the scene and take several screenshots to reuse them afterwhile, but I'd like to do it by code ;)
Thank you :)

in Engine by (288 points)
edited by

Thank you, I already tried the first method, which is not quite adapted, because of "getscreencapture()"

However the second one seems interesting, I will try it tonight and keep you advised :)

have you ever got anywhere with this? might answer your own question for posterity.

I'm wondering how to draw a custom texture from the ground up, however without using _draw.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.