feat: 勇士显伤

This commit is contained in:
hunhou001 committed 2023-09-27 12:14:05 +08:00
1 parent c242018ee8
commit b3e3ae5f8e
3 files changed
+47

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
function drawHeroDetail(px: number, py: number) {
if (!core.getLocalStorage('heroDetail', false)) return;
const { hp, atk, def } = core.status.hero;
const toDraw = {
atk: {
value: atk,
color: '#FF7A7A'
},
def: {
value: def,
color: '#00E6F1'
},
hp: {
value: hp,
color: '#F9FFFF0'
}
};
let i = 0;
for (const [key, value] of Object.entries(toDraw)) {
const ctx = core.canvas['hero'].canvas;
core.fillBoldText(
ctx,
value.value.toString(),
px,
py - 10 * i,
value.color as string
);
i++;
}
}
export { drawHeroDetail };