MCPcopy Create free account
hub / github.com/ddnet/ddnet / UpdateMovementInformationTextContainer

Method UpdateMovementInformationTextContainer

src/game/client/components/hud.cpp:1405–1418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1403}
1404
1405void CHud::UpdateMovementInformationTextContainer(STextContainerIndex &TextContainer, float FontSize, float Value, float &PrevValue)
1406{
1407 Value = std::round(Value * 100.0f) / 100.0f; // Round to 2dp
1408 if(TextContainer.Valid() && PrevValue == Value)
1409 return;
1410 PrevValue = Value;
1411
1412 char aBuf[128];
1413 str_format(aBuf, sizeof(aBuf), "%.2f", Value);
1414
1415 CTextCursor Cursor;
1416 Cursor.m_FontSize = FontSize;
1417 TextRender()->RecreateTextContainer(TextContainer, &Cursor, aBuf);
1418}
1419
1420void CHud::RenderMovementInformationTextContainer(STextContainerIndex &TextContainer, const ColorRGBA &Color, float X, float Y)
1421{

Callers

nothing calls this directly

Calls 4

str_formatFunction · 0.85
TextRenderFunction · 0.85
RecreateTextContainerMethod · 0.80
ValidMethod · 0.45

Tested by

no test coverage detected