diff --git a/birb/modules/menusystem/menus/widgets/text.lua b/birb/modules/menusystem/menus/widgets/text.lua index 8c3d675..3831357 100644 --- a/birb/modules/menusystem/menus/widgets/text.lua +++ b/birb/modules/menusystem/menus/widgets/text.lua @@ -30,6 +30,18 @@ function TextWidget:new(menu, font, label) TextWidget.super.new(self, menu) self.font = font self.label = label + self:setSelectedColor(1, 1, 1) +end + +function TextWidget:setSelectedColor(r, g, b) + self.selectedColor = {} + self.selectedColor.r = r + self.selectedColor.g = g + self.selectedColor.b = b +end + +function TextWidget:getSelectedColor() + return self.selectedColor.r, self.selectedColor.g, self.selectedColor.b end function TextWidget:drawCanvas() @@ -39,4 +51,11 @@ function TextWidget:drawCanvas() self.font:draw(self.label, w, h, -1, "center") end +function TextWidget:drawSelected(x, y, w, h) + local r, g, b = self:getSelectedColor() + love.graphics.setColor(r, g, b, 1) + self:draw(x, y) + utils.graphics.resetColor() +end + return TextWidget