From 07400ce991045f7ae21beb398b1687d5a047aad2 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 3 Sep 2021 11:13:06 +0200 Subject: [PATCH] feat(textElem): add opacity handling --- sonic-radiance.love/birb/modules/gui/elements/text.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sonic-radiance.love/birb/modules/gui/elements/text.lua b/sonic-radiance.love/birb/modules/gui/elements/text.lua index ce24c2b..0db3ec0 100644 --- a/sonic-radiance.love/birb/modules/gui/elements/text.lua +++ b/sonic-radiance.love/birb/modules/gui/elements/text.lua @@ -7,6 +7,7 @@ function TextElement:new(name, fontName, text, x, y, align) self.font = self.assets.fonts[fontName] self.align = align + self.opacity = 1 end function TextElement:getText() @@ -14,7 +15,9 @@ function TextElement:getText() end function TextElement:draw() + self.font:setColor(1, 1, 1, self.opacity) self.font:draw(self:getText(), self.x, self.y, -1, self.align) + love.graphics.setColor(1, 1, 1, 1) end return TextElement \ No newline at end of file