From 47dea647a040ebea015253363a06be36ffb6458a Mon Sep 17 00:00:00 2001 From: PeaAshMeter Date: Mon, 15 Dec 2025 03:23:34 +0300 Subject: [PATCH] make hp bar text more clear --- lib/simple_ui/level/bar.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/simple_ui/level/bar.lua b/lib/simple_ui/level/bar.lua index b91701e..9bacb90 100644 --- a/lib/simple_ui/level/bar.lua +++ b/lib/simple_ui/level/bar.lua @@ -57,10 +57,10 @@ function barElement:draw() love.graphics.setColor(1, 1, 1) --- текст поверх if self.drawText then - local font = Tree.fonts:getDefaultTheme():getVariant("small") - love.graphics.setFont(font) - love.graphics.printf(tostring(self.value) .. "/" .. tostring(self.maxValue), self.bounds.x, - self.bounds.y, self.bounds.width, "center") + local font = Tree.fonts:getDefaultTheme():getVariant("medium") + local t = love.graphics.newText(font, tostring(self.value) .. "/" .. tostring(self.maxValue)) + love.graphics.draw(t, math.floor(self.bounds.x + self.bounds.width / 2 - t:getWidth() / 2), + math.floor(self.bounds.y + self.bounds.height / 2 - t:getHeight() / 2)) end self:drawBorder("inner")