diff --git a/birb/modules/menusystem/menus/widgets/text.lua b/birb/modules/menusystem/menus/widgets/text.lua index 4b16ff9..c06450c 100644 --- a/birb/modules/menusystem/menus/widgets/text.lua +++ b/birb/modules/menusystem/menus/widgets/text.lua @@ -52,22 +52,30 @@ function TextWidget:setSelectedColor(r, g, b) self.selectedColor.b = b end +function TextWidget:getFont() + return self.assets:getFont(self.font) +end + function TextWidget:getSelectedColor() return self.selectedColor.r, self.selectedColor.g, self.selectedColor.b end +function TextWidget:getPadding() + return self.padding +end + function TextWidget:drawCanvas() local w, h - local font = self.assets:getFont(self.font) + local font = self:getFont() h = math.floor(self.height / 2) - (font:getHeight() / 2) for _, complexLabel in pairs(self.labels) do if (complexLabel.position == "center") then w = math.floor(self.width / 2) elseif (complexLabel.position == "left") then - w = self.padding + w = self:getPadding() elseif (complexLabel.position == "right") then - w = math.floor(self.width - self.padding) + w = math.floor(self.width - self:getPadding()) end font:draw(complexLabel.label, w, h, -1, complexLabel.position) end