Drawing an overlay

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By LoBo

I want to draw an overlay, think of a heatmap for instance. I’ve got quite a simple setup: A TileMap which I use to draw tiles. In addition i have a “LevelRunner” Script in the Scene root which manages the different contents of my tiles (like gases which have a pressure and a temp etc). Now I want to draw different overlays like a heatmap (so heat spreads from heat sources to nearby tiles and I want to visualize that).

Let’s say I have the following structure/heat matrix:

contents = [
            [1,2,3], 
            [2,3,4], 
            [3,4,5]
           ]

In the first step I don’t want to be too detailed or fance, a simply overlay tile per base tile would be fine - something like the Basic Heatmap here (overlay every tile with a RGBA): Heatmaps in Python

Note: This is not a question about how to calculate the color of a tempature or something, just a godot question, how to draw such an overlay over a TileMap.
What I tried: https://forum.godotengine.org/9602/color-modulate-tilemap

SceneRoot
|-- Canvas Layer
|         - CanvasModulate
|         - Tilemap (Overlay)
|-- Tilemap (Normal)

With that I can only draw an overlay over specific parts, but not a different color over every tile. As far as I understood things the TileMap seems to be the wrong tool for drawing overlays. What should I use instead? What’s the best approach, something like a CanvasLayer and drawing a lot of CanvasItems? It that a good idea considering performance?
Greetings,
LoBo

is it similar to tint ?

asetyowatir | 2018-03-09 15:16