diff options
author | Andreas Haas <liu.gam3@gmail.com> | 2017-03-05 11:39:00 +0100 |
---|---|---|
committer | Andreas Haas <liu.gam3@gmail.com> | 2017-03-05 11:42:01 +0100 |
commit | 962243f931917c3055e73c387853fe1e7f255395 (patch) | |
tree | decabe83291326f5acdb7bcce5d6d91c87fdcc80 /scene/2d | |
parent | 94103c0c025f04e75d5e163d9f0bdde27bb0c848 (diff) |
TileMap: Respect self_modulate property
Now `TileMap`s make use of the `self_modulate` property.
There's still a bug: The Editor doesn't re-draw with the new color when you change the TileMaps `self_modulate`
in the inspector. You'll have to make it update manually (by placing a tile, changing the transform, etc..)
I'll open an issue for that after this is merged (If I don't fix it in the meantime ^^).
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/tile_map.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 15fbec4441..f89a72e1b9 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -458,6 +458,9 @@ void TileMap::_update_dirty_quadrants() { Color modulate = tile_set->tile_get_modulate(c.id); + Color self_modulate = get_self_modulate(); + modulate = Color(modulate.r*self_modulate.r, modulate.g*self_modulate.g, + modulate.b*self_modulate.b, modulate.a*self_modulate.a); if (r==Rect2()) { tex->draw_rect(canvas_item,rect,false,modulate,c.transpose); } else { |