Refonte pour utiliser le systeme de GUI #112

Merged
kazhnuz merged 102 commits from feat/gui into master 2022-01-06 19:15:16 +01:00
Showing only changes of commit d972fccb13 - Show all commits

View file

@ -13,6 +13,7 @@ function GuiElement:new(name, x, y, w, h)
self.depth = 0 self.depth = 0
self.tweens = TweenManager(self) self.tweens = TweenManager(self)
self.assets = self:getAssets()
self:register() self:register()
end end
@ -22,6 +23,11 @@ function GuiElement:getGui()
return scene.gui return scene.gui
end end
function GuiElement:getAssets()
local scene = core.scenemanager.nextScene or core.scenemanager.currentScene
return scene.assets
end
function GuiElement:register() function GuiElement:register()
local gui = self:getGui() local gui = self:getGui()
self.creationId = gui:addElement(self.name, self) self.creationId = gui:addElement(self.name, self)