feat(textElem): add opacity handling

This commit is contained in:
Kazhnuz 2021-09-03 11:13:06 +02:00
parent 959fd99ba4
commit 07400ce991

View file

@ -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