chore: add a screen package
This commit is contained in:
parent
c4db0f7d14
commit
7ca60da3fd
1 changed files with 4 additions and 3 deletions
|
@ -7,9 +7,8 @@ local TweenManager = require "birb.classes.time"
|
||||||
local elementDataStruct = require "birb.structures.elementData"
|
local elementDataStruct = require "birb.structures.elementData"
|
||||||
|
|
||||||
|
|
||||||
function GuiScreen:new(name, controller)
|
function GuiScreen:new(name)
|
||||||
self:initWrapper()
|
self:initWrapper()
|
||||||
self.controller = controller or self.gui
|
|
||||||
self.name = name
|
self.name = name
|
||||||
self.isVisible = false
|
self.isVisible = false
|
||||||
self.transforms = {}
|
self.transforms = {}
|
||||||
|
@ -17,13 +16,15 @@ function GuiScreen:new(name, controller)
|
||||||
|
|
||||||
self:reset()
|
self:reset()
|
||||||
self:registerElements()
|
self:registerElements()
|
||||||
self.controller:addScreen(name, self)
|
self.gui:addScreen(name, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function GuiScreen:initWrapper()
|
function GuiScreen:initWrapper()
|
||||||
local scene = core.scenemanager.nextScene or core.scenemanager.currentScene
|
local scene = core.scenemanager.nextScene or core.scenemanager.currentScene
|
||||||
self.scene = scene
|
self.scene = scene
|
||||||
self.gui = scene.gui
|
self.gui = scene.gui
|
||||||
|
-- Présent pour la compatibilité
|
||||||
|
self.controller = self.gui
|
||||||
self.assets = scene.assets
|
self.assets = scene.assets
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue