From 44781ba3254178754dbb3c5482cf80ff3746d6c2 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 28 Aug 2021 11:24:09 +0200 Subject: [PATCH] feat: add line sizing --- sonic-radiance.love/birb/modules/gui/textmenu/init.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sonic-radiance.love/birb/modules/gui/textmenu/init.lua b/sonic-radiance.love/birb/modules/gui/textmenu/init.lua index e36f8cf..5b3b607 100644 --- a/sonic-radiance.love/birb/modules/gui/textmenu/init.lua +++ b/sonic-radiance.love/birb/modules/gui/textmenu/init.lua @@ -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)