Skip to content

Can I "flatten" a node tree before setting opacity? #2429

Closed Answered by rh101
FHBlah asked this question in Q&A
Discussion options

You must be logged in to vote

I tried rendering the HUD to a RenderTexture and then applying transparency to the resulting sprite. This works but I would want to hide the original HUD and only show the final transparent one.

That is one way to handle it.

The only way I could think of doing this would be to keep the original off screen. Unfortunately, RenderTexture can only capture what's on screen.

You can render anything to the RenderTexture, and what you render does not need to be part of the scene. One way that may work is if your HUD is part of the scene, but just not visible, then you can make it visible, render to the render texture, then turn visibility off again.

Alternatively, just don't put the root node…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@aismann
Comment options

aismann Mar 6, 2025
Collaborator

@rh101
Comment options

rh101 Mar 6, 2025
Collaborator

Answer selected by FHBlah
Comment options

You must be logged in to vote
1 reply
@DelinWorks
Comment options

Comment options

You must be logged in to vote
2 replies
@rh101
Comment options

rh101 Mar 10, 2025
Collaborator

@FHBlah
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants