From d972fccb13952e3c3c41a7818e5659f0477f6496 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 30 Aug 2021 14:10:26 +0200 Subject: [PATCH] feat: add assets access to gui elements --- sonic-radiance.love/birb/modules/gui/elements/parent.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sonic-radiance.love/birb/modules/gui/elements/parent.lua b/sonic-radiance.love/birb/modules/gui/elements/parent.lua index 5103a04..1de6125 100644 --- a/sonic-radiance.love/birb/modules/gui/elements/parent.lua +++ b/sonic-radiance.love/birb/modules/gui/elements/parent.lua @@ -13,6 +13,7 @@ function GuiElement:new(name, x, y, w, h) self.depth = 0 self.tweens = TweenManager(self) + self.assets = self:getAssets() self:register() end @@ -22,6 +23,11 @@ function GuiElement:getGui() return scene.gui end +function GuiElement:getAssets() + local scene = core.scenemanager.nextScene or core.scenemanager.currentScene + return scene.assets +end + function GuiElement:register() local gui = self:getGui() self.creationId = gui:addElement(self.name, self)