Want the foreground of the viewport to go black completely hiding the scene, except some buttons and figure

: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, I am working on a game, where as the timer hits zero, the “light” or so to say (foreground), goes black(dark), except for a figure and a few buttons. How can i do that?

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

but it only sets the back ground black.

Thanks

:bust_in_silhouette: Reply From: eons

Clear color is to set how the display manages the screen buffer (to say it short).

You can use a CanvasModulate node to tint everything in a CanvasLayer.

But if you have things on many layers or mixed in a single one, maybe a big white light in substract mode could be better (opacity can be animated too), just change the light item mask and node’s light masks to keep visible the ones you want.