Foreground/Background set color to black

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By yeeshu06
:warning: Old Version Published before Godot 3 was released.

Hey,

Wanted to ask, as soon as i display game over i want all the back ground and foreground to go black…how can i do this.

I tried,
var color_black = Color(0,0,0,1)
VisualServer.set_default_clear_color(color_black)

but it only sets the back ground black.

Thanks

What do you mean by “foreground”? There is no foreground beyond what you actually put in your scene.

Zylann | 2017-04-04 12:38

Yeah sorry thats what i mean. Over everything i have put…how can i make it all black…n just show gameover

yeeshu06 | 2017-04-04 12:39

Just add a sprite-node. In the dropdown menu of “Texture” select “New ImageTexture”. Click on the little arrow on the right of the dropdown menu and change the size there.
it must be the last object in your scene tree, then it covers everything else.

bobokox | 2017-04-04 14:46

:bust_in_silhouette: Reply From: eons

If 2D, use a CanvasModulate node to tint everything to black (with a Tween, AnimationPlayer, etc.).

Add to another CanvasLayer the nodes you keep apart from the CanvasModulate effect.


Clear color is the color used to clear the video buffer.