Display commander damage

This commit is contained in:
Correl Roush 2023-05-02 16:28:44 -04:00
parent d991d7c563
commit e6ee237dbf

View file

@ -580,6 +580,16 @@ protected:
canvas.setFont(&fonts::Orbitron_Light_32); canvas.setFont(&fonts::Orbitron_Light_32);
canvas.setTextSize(3); canvas.setTextSize(3);
canvas.drawCenterString(String(lifeTotal, DEC), rect->width / 2, (rect->height / 2) - (canvas.fontHeight() / 2)); 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); canvas.pushSprite(rect->x, rect->y);
} }