Skip to content

Commit

Permalink
viz console: add fading effect
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jan 6, 2024
1 parent debe035 commit e153479
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mola_viz/src/MolaViz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,17 @@ std::future<bool> MolaViz::output_console_message(

for (size_t i = 0; i < winData.console_messages.size(); i++)
{
const size_t invIdx = (winData.console_messages.size() - 1 - i);

fp.color.A = 1.0f;
if (invIdx > 1 && invIdx + 3 >= max_console_lines_)
{
fp.color.A =
1.0 - (invIdx - (max_console_lines_ * 1.0 - 3.5)) / 3.5;
}

topWin->background_scene->getViewport()->addTextMessage(
3.0, LINE_SPACING + (LINE_SPACING + LINE_HEIGHT) * i,
3.0, LINE_SPACING + (LINE_SPACING + LINE_HEIGHT) * invIdx,
winData.console_messages.at(i), i, fp);
}

Expand Down

0 comments on commit e153479

Please sign in to comment.