36 lines
641 B
C++
36 lines
641 B
C++
#include "scoreitem.hpp"
|
|
|
|
ScoreItem::ScoreItem ( string Name, int Lines )
|
|
{
|
|
this->Name = Name;
|
|
this->Lines = Lines;
|
|
|
|
message = NULL;
|
|
|
|
textColor = make_color(255, 255, 255);
|
|
}
|
|
|
|
ScoreItem::~ScoreItem()
|
|
{
|
|
|
|
}
|
|
|
|
void ScoreItem::Draw ( game * Game, int y )
|
|
{
|
|
char temp[10];
|
|
|
|
message = TTF_RenderText_Solid( Game->GetfontMenu(), Name.c_str(), textColor);
|
|
apply_surface(105, y, message, Game->GetScreen());
|
|
|
|
std::sprintf ( temp, "%d", Lines);
|
|
message = TTF_RenderText_Solid( Game->GetfontMenu(), temp, textColor);
|
|
apply_surface(15, y, message, Game->GetScreen());
|
|
|
|
SDL_FreeSurface(message);
|
|
}
|
|
|
|
int ScoreItem::GetLines()
|
|
{
|
|
return Lines;
|
|
}
|