0 votes

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 colorblack = Color(0,0,0,1)
VisualServer.set
defaultclearcolor(color_black)

but it only sets the back ground black.

Thanks

asked Apr 4, 2017 in Engine by yeeshu06 (72 points)

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

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

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.

1 Answer

+1 vote

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.

answered Apr 4, 2017 by eons (7,786 points)
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 How to use this Q&A? before posting your first questions.