diff --git a/libs/exemples/hud_lib_test.txt b/libs/exemples/hud_lib_test.txt index 8bd4e1e..e23f8f6 100644 --- a/libs/exemples/hud_lib_test.txt +++ b/libs/exemples/hud_lib_test.txt @@ -1,6 +1,9 @@ --@name --@client --@owneronly +--@include hud_lib.txt + +require("hud_lib.txt") local myWindow = createWindow("Window", 100, 100, 300, 200) addChild(myWindow, createLabel("Hello world!", 20, 50)) @@ -9,12 +12,13 @@ addChild(myWindow, createButton("Ok", 20, 100, 100, 30, function() input.enableCursor(false) end)) -hook.add("think", "toggleWindowOnInsert", function() - if input.wasKeyPressed(KEY.INSERT) then +hook.add("InputPressed", "toggleWindow", function(a) + if a == KEY.INSERT then toggleWindow(myWindow) end end) + hook.add("render", "drawMyWindow", function() drawWindow(myWindow) end)