diff options
| author | SushiTee <weichel.sascha@xxx.xx> | 2011-04-02 13:56:46 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-04-02 15:18:45 +0200 |
| commit | 0db6022c642352dc3d68814f43ef0c9ca9395274 (patch) | |
| tree | ceddd771cfe9f31d04985af5b1e5e50bf1efc43e /src/game/client/components | |
| parent | 2c9b454fb8396874d4e4588a28cadb4f5886968a (diff) | |
| download | zcatch-0db6022c642352dc3d68814f43ef0c9ca9395274.tar.gz zcatch-0db6022c642352dc3d68814f43ef0c9ca9395274.zip | |
centering scoreboard (goals and spectators) correctly
Diffstat (limited to 'src/game/client/components')
| -rw-r--r-- | src/game/client/components/scoreboard.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index a5e21c94..edf9eb4b 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -51,7 +51,7 @@ void CScoreboard::RenderGoals(float x, float y, float w) Graphics()->TextureSet(-1); Graphics()->QuadsBegin(); Graphics()->SetColor(0,0,0,0.5f); - RenderTools()->DrawRoundRect(x-10.f, y, w, h, 10.0f); + RenderTools()->DrawRoundRect(x, y, w, h, 10.0f); Graphics()->QuadsEnd(); // render goals @@ -62,20 +62,20 @@ void CScoreboard::RenderGoals(float x, float y, float w) { char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %d", Localize("Score limit"), m_pClient->m_Snap.m_pGameInfoObj->m_ScoreLimit); - TextRender()->Text(0, x, y, 20.0f, aBuf, -1); + TextRender()->Text(0, x+10.0f, y, 20.0f, aBuf, -1); } if(m_pClient->m_Snap.m_pGameInfoObj->m_TimeLimit) { char aBuf[64]; str_format(aBuf, sizeof(aBuf), Localize("Time limit: %d min"), m_pClient->m_Snap.m_pGameInfoObj->m_TimeLimit); - TextRender()->Text(0, x+220.0f, y, 20.0f, aBuf, -1); + TextRender()->Text(0, x+230.0f, y, 20.0f, aBuf, -1); } if(m_pClient->m_Snap.m_pGameInfoObj->m_RoundNum && m_pClient->m_Snap.m_pGameInfoObj->m_RoundCurrent) { char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s %d/%d", Localize("Round"), m_pClient->m_Snap.m_pGameInfoObj->m_RoundCurrent, m_pClient->m_Snap.m_pGameInfoObj->m_RoundNum); float tw = TextRender()->TextWidth(0, 20.0f, aBuf, -1); - TextRender()->Text(0, x+w-tw-20.0f, y, 20.0f, aBuf, -1); + TextRender()->Text(0, x+w-tw-10.0f, y, 20.0f, aBuf, -1); } } } @@ -89,12 +89,12 @@ void CScoreboard::RenderSpectators(float x, float y, float w) Graphics()->TextureSet(-1); Graphics()->QuadsBegin(); Graphics()->SetColor(0,0,0,0.5f); - RenderTools()->DrawRoundRect(x-10.f, y, w, h, 10.0f); + RenderTools()->DrawRoundRect(x, y, w, h, 10.0f); Graphics()->QuadsEnd(); // Headline y += 10.0f; - TextRender()->Text(0, x, y, 28.0f, Localize("Spectators"), w-20.0f); + TextRender()->Text(0, x+10.0f, y, 28.0f, Localize("Spectators"), w-20.0f); // spectator names y += 30.0f; @@ -113,7 +113,7 @@ void CScoreboard::RenderSpectators(float x, float y, float w) Multiple = true; } CTextCursor Cursor; - TextRender()->SetCursor(&Cursor, x, y, 22.0f, TEXTFLAG_RENDER); + TextRender()->SetCursor(&Cursor, x+10.0f, y, 22.0f, TEXTFLAG_RENDER); Cursor.m_LineWidth = w-20.0f; Cursor.m_MaxLines = 4; TextRender()->TextEx(&Cursor, aBuffer, -1); |