+1 vote

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): https://plot.ly/python/heatmaps/

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://godotengine.org/qa/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

asked Mar 9, 2018 in Engine by LoBo (13 points)

is it similar to tint ?

Please log in or register to answer this question.

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.