feat: add line sizing

This commit is contained in:
Kazhnuz 2021-08-28 11:24:09 +02:00
parent afad9f7d08
commit 44781ba325

View file

@ -31,13 +31,15 @@ TextMenu.baseWidgets = require "birb.modules.gui.textmenu.widgets"
local BASE_PADDING = 8
function TextMenu:new(name, font, x, y, w, slotNumber, padding)
function TextMenu:new(name, font, x, y, w, slotNumber, padding, lineSize)
lineSize = lineSize or 1
self:setFont(font)
self.lineHeight = self.font:getHeight() * lineSize
self.name = name
local h = self.font:getHeight() * slotNumber
self.padding = padding or BASE_PADDING
self:setSelectedColor(1,1,1)
TextMenu.super.new(self, name, x, y, w, h, slotNumber)
TextMenu.super.new(self, name, x, y, w, (self.lineHeight * slotNumber), slotNumber)
end
function TextMenu:setFont(fontName)