Hello!
I am trying to create grid with the ability to highlight tiles with color depending on selection, enemies etc. I have created an enum with different highlight modes and created a map in my tile widget (which is part of a tile actor through the UWidgetComponent and Image widget) to get highlight color depending on highlight mode. Grid tile actor itself works great, except for one thing: it stops rendering after changing image’s color in any manner, either by calling SetColorAndOpacity or by binding color to function.
Here is how it looks like before trying to select:
And here is how it looks like after I try to select two cells:
And here is code that I use for setting tint:
void ADaldosWidgetGridTile::SetHighlightMode(EHighlightMode HighlightMode)
{
Super::SetHighlightMode(HighlightMode); // Installs field to check highlight mode later
FLinearColor NewHighlightmentColor = HighlightColors.Contains(HighlightMode)
? HighlightColors[HighlightMode]
: DefaultColor;
GridTileWidgetComponent->SetTintColorAndOpacity(NewHighlightmentColor);
}
How can I fix this problem? This is really some basic feature and I can’t write even it. Thank you in advance!