-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScorePanel.cpp
39 lines (33 loc) · 973 Bytes
/
ScorePanel.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**************************************************************************
** Qt Creator license header template
** Special keywords: dpinol 08/03/2014 2014
** Environment variables:
** To protect a percent sign, use '%'.
**************************************************************************/
#include "ScorePanel.h"
#include "Game.h"
#include <utils/utils.h>
#include <model/Match.h>
#include <SDL_rect.h>
#include <SDL_test_font.h>
ScorePanel::ScorePanel(Match &match)
:m_match(match)
{
}
void ScorePanel::draw()
{
SDL_Rect rect;
rect.x = 20;
rect.y = 35;
rect.w = 200;
rect.h = 200;
SDL_Renderer *renderer = TheGame::Instance()->getRenderer();
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderFillRect(renderer, &rect);
//SDL_FillRect()
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
SDLTest_DrawString(renderer, 80, 80, ("Score: " + dani::toString(m_match.getScore())).c_str());
}
void ScorePanel::update()
{
}