I'm confused with CanvasModulate.

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

I know it is used to tint the screen but still don’t understand. Please Help!

The properties it has and how to use it. Can someone please help!
I am an absolute beginner.

I see there are two function void set_color(Color color) , Color get_color()

But still do not know how to use it! Can someone give a tutorial on it???

what part did you not understand for CanvasModulate?
you can’t see color is changed even though you changed it on inspector panel or in script?

volzhs | 2017-11-15 10:58

:bust_in_silhouette: Reply From: Zylann

CanvasModulate tints everything drawn in 2D with a color. For example, if you have a tilemap with some sprites and set a reddish color in CanvasModulate, your sprites and tilemap will become reddish. It is useful to adjust the color tone of a level, doing day/night effects etc.

More details about scenes and nodes: http://docs.godotengine.org/en/stable/learning/step_by_step/scenes_and_nodes.html

You can set the tint color by clicking on the CanvasModulate node, then modify the color property in the inspector dock.

if you want to modify this color using a script (like changing color if something happens in the game), that’s where you would use get_color and set_color. Like this:

node.set_color(Color(1,0,0)) # Set a red tint

More details on scripting: http://docs.godotengine.org/en/stable/learning/step_by_step/scripting.html