forked from scarsty/kys-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShowExp.cpp
More file actions
28 lines (25 loc) · 813 Bytes
/
ShowExp.cpp
File metadata and controls
28 lines (25 loc) · 813 Bytes
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
#include "ShowExp.h"
#include "Font.h"
#include "TextureManager.h"
#include "strfunc.h"
ShowExp::ShowExp()
{
x_ = 100;
y_ = 100;
}
ShowExp::~ShowExp()
{
}
void ShowExp::draw()
{
Engine::getInstance()->fillColor({ 0, 0, 0, 128 }, 0, 0, -1, -1);
Font::getInstance()->draw(text_, 30, x_, y_, { 255, 255, 255, 255 });
for (int i = 0; i < roles_.size(); i++)
{
auto r = roles_[i];
int x = x_ + i % 5 * 180, y = y_ + 50 + i / 5 * 100;
TextureManager::getInstance()->renderTexture("head", r->HeadID, x, y, { 255,255,255,255 }, 255, 0.5, 0.5);
Font::getInstance()->draw(fmt1::format("{}", r->Name), 20, x + 90, y + 30, { 255, 255, 255, 255 });
Font::getInstance()->draw(fmt1::format("{}", r->ExpGot), 20, x + 90, y + 55, { 255, 255, 255, 255 });
}
}