diff --git a/sonic-radiance.love/core/modules/menusystem/widgets/init.lua b/sonic-radiance.love/core/modules/menusystem/widgets/init.lua index 5f09959..cd01267 100644 --- a/sonic-radiance.love/core/modules/menusystem/widgets/init.lua +++ b/sonic-radiance.love/core/modules/menusystem/widgets/init.lua @@ -130,17 +130,20 @@ end -- TEXT WIDGET -- Simple text widget -function TextWidget:new(menu, font, label) +function TextWidget:new(menu, font, label, color) TextWidget.super.new(self, menu) self.font = font self.label = label + self.color = color or {1, 1, 1} end function TextWidget:drawCanvas() local w, h w = math.floor(self.width / 2) h = math.floor(self.height / 2) - (self.font:getHeight() / 2) + self.font:setColor(self.color[1], self.color[2], self.color[3], 1) self.font:draw(self.label, w, h, -1, "center") + self.font:setColor(1, 1, 1, 1) end -- Add the widget as subvariable to the returned table diff --git a/sonic-radiance.love/game/modules/menus/fancy.lua b/sonic-radiance.love/game/modules/menus/fancy.lua index 65d4224..0fe52f2 100644 --- a/sonic-radiance.love/game/modules/menus/fancy.lua +++ b/sonic-radiance.love/game/modules/menus/fancy.lua @@ -52,8 +52,11 @@ end function fancy.BaseWidget:drawCanvas() love.graphics.draw(self.box, 0, 0) local h = math.floor(self.height / 2) - (self.font:getHeight() / 2) - 2 + self.font:setColor(self.color[1], self.color[2], self.color[3], 1) self.font:draw(self.label, 16, h, -1, "left") self.font:draw(self.label2, self.width -8, h, -1, "right") + self.font:setColor(1, 1, 1, 1) + utils.graphics.resetColor() end -- Widget de sous-menu diff --git a/sonic-radiance.love/game/modules/menus/list.lua b/sonic-radiance.love/game/modules/menus/list.lua index c3ad48d..352e95e 100644 --- a/sonic-radiance.love/game/modules/menus/list.lua +++ b/sonic-radiance.love/game/modules/menus/list.lua @@ -123,7 +123,10 @@ end function list.CenteredWidget:drawCanvas() local h = math.floor(self.height / 2) - (self.font:getHeight() / 2) - 2 + self.font:setColor(self.color[1], self.color[2], self.color[3], 1) self.font:draw(self.label, self.width / 2, h, -1, "center") + self.font:setColor(1, 1, 1, 1) + utils.graphics.resetColor() end -- Widget avec deux bouts de textes @@ -134,8 +137,11 @@ end function list.DualTextWidget:drawCanvas() local h = math.floor(self.height / 2) - (self.font:getHeight() / 2) + self.font:setColor(self.color[1], self.color[2], self.color[3], 1) self.font:draw(self.label, 16, h, -1, "left") self.font:draw(self.label2, self.width - 8, h, -1, "right") + self.font:setColor(1, 1, 1, 1) + utils.graphics.resetColor() end -- Widget de sous-menu diff --git a/sonic-radiance.love/game/modules/menus/parents/widget.lua b/sonic-radiance.love/game/modules/menus/parents/widget.lua index 0bd30bc..752f1e0 100644 --- a/sonic-radiance.love/game/modules/menus/parents/widget.lua +++ b/sonic-radiance.love/game/modules/menus/parents/widget.lua @@ -1,13 +1,13 @@ local Widget = require "core.modules.menusystem.widgets" local RadianceWidget = Widget.Text:extend() -function RadianceWidget:new(scene, name, label) +function RadianceWidget:new(scene, name, label, color) self.scene = scene local label = label or "" local font = scene.assets.fonts["small"] font:setFilter("shadow") local widgetMenu = scene.menusystem.menus[name] - RadianceWidget.super.new(self, widgetMenu, font, label) + RadianceWidget.super.new(self, widgetMenu, font, label, color) end return RadianceWidget