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 70f1fe21e9 - Show all commits

View file

@ -18,6 +18,10 @@ function GuiElement:new(name, x, y, w, h)
self:register() self:register()
end end
function GuiElement:setKeyPressAction(func)
self.func = func
end
function GuiElement:getGui() function GuiElement:getGui()
local scene = core.scenemanager.nextScene or core.scenemanager.currentScene local scene = core.scenemanager.nextScene or core.scenemanager.currentScene
return scene.gui return scene.gui
@ -127,7 +131,9 @@ end
-- Handle key press -- Handle key press
function GuiElement:keypressed(key) function GuiElement:keypressed(key)
-- Cette fonction ne contient rien par défaut if (self.func ~= nil) then
self.func(key)
end
end end
-- MOUSE FUNCTIONS -- MOUSE FUNCTIONS