I’d like to “tint” several specific elements in a TileMap2D to reuse tiles. Is it possible to apply a custom material when drawing the tilemap or setting a tile? Is there any example about this? Any hint would be much appreciated.
Material on 2D tilemap


Well, I think I will not get any answer on this. But finally I understand that it is possible to apply a custom material to a specific sprite in the tilemap, so, Which technique should I use to add a tinted effect on a tile? Where is the info about materials/techniques use cases? Where do I find documentation on material parameters and their effect? I haven’t found any useful on the examples nor in the docs…
I really need help with this guys.
Thanks.

Where is the info about materials/techniques use cases?
https://urho3d.github.io/documentation/HEAD/_materials.html
To change material color:
- clone material to make it unique
-
material->SetShaderParameter(“MatDiffColor”, Color::RED);
https://github.com/1vanK/Urho3DOutlineSelectionExample/blob/master/Game.cpp

Theoretically, you could use sprite.color (like we do in sample #32 when tinting the grabbed sprite in red). For exemple:
sprite.color = Color(0, 0, 1); // Blue tint
sprite.color = Color(0, 1, 0); // Grey tint
These will work, however other combinations (including pure red) don’t and I have no clue why.

Theoretically, you could use sprite.color (like we do in sample #32 when tinting the grabbed sprite in red).
That’s what I need. Thanks!!