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

Method RenderLocalTime

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

Source from the content-addressed store, hash-verified

1609}
1610
1611void CHud::RenderLocalTime(float x)
1612{
1613 if(!g_Config.m_ClShowLocalTimeAlways && !GameClient()->m_Scoreboard.IsActive())
1614 return;
1615
1616 // draw the box
1617 Graphics()->DrawRect(x - 30.0f, 0.0f, 25.0f, 12.5f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.4f), IGraphics::CORNER_B, 3.75f);
1618
1619 // draw the text
1620 char aTimeStr[6];
1621 str_timestamp_format(aTimeStr, sizeof(aTimeStr), "%H:%M");
1622 TextRender()->Text(x - 25.0f, (12.5f - 5.f) / 2.f, 5.0f, aTimeStr, -1.0f);
1623}
1624
1625void CHud::OnNewSnapshot()
1626{

Callers

nothing calls this directly

Calls 7

GraphicsFunction · 0.85
str_timestamp_formatFunction · 0.85
TextRenderFunction · 0.85
DrawRectMethod · 0.80
TextMethod · 0.80
ColorRGBAClass · 0.70
IsActiveMethod · 0.45

Tested by

no test coverage detected