Display commander damage
This commit is contained in:
parent
d991d7c563
commit
e6ee237dbf
1 changed files with 10 additions and 0 deletions
10
src/main.cpp
10
src/main.cpp
|
@ -580,6 +580,16 @@ protected:
|
|||
canvas.setFont(&fonts::Orbitron_Light_32);
|
||||
canvas.setTextSize(3);
|
||||
canvas.drawCenterString(String(lifeTotal, DEC), rect->width / 2, (rect->height / 2) - (canvas.fontHeight() / 2));
|
||||
if (mode == Playing) {
|
||||
canvas.setTextSize(1);
|
||||
canvas.setTextColor(TFT_DARKGREY);
|
||||
int rotate = rect->rotation == 0 ? 1 : -1;
|
||||
int offset = 60 * rotate;
|
||||
canvas.drawCenterString(String(players[player].commanderDamage[0], DEC), rect->width / 2 - offset, (rect->height / 2) - (canvas.fontHeight() / 2) - offset, &fonts::Orbitron_Light_24);
|
||||
canvas.drawCenterString(String(players[player].commanderDamage[1], DEC), rect->width / 2 + offset, (rect->height / 2) - (canvas.fontHeight() / 2) - offset, &fonts::Orbitron_Light_24);
|
||||
canvas.drawCenterString(String(players[player].commanderDamage[2], DEC), rect->width / 2 - offset, (rect->height / 2) - (canvas.fontHeight() / 2) + offset, &fonts::Orbitron_Light_24);
|
||||
canvas.drawCenterString(String(players[player].commanderDamage[3], DEC), rect->width / 2 + offset, (rect->height / 2) - (canvas.fontHeight() / 2) + offset, &fonts::Orbitron_Light_24);
|
||||
}
|
||||
canvas.pushSprite(rect->x, rect->y);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue