From c46ccd14942ff558ed9b7b7dfb7073f1ace34d6c Mon Sep 17 00:00:00 2001 From: Niko <124378025+happy1063@users.noreply.github.com> Date: Thu, 6 Mar 2025 20:59:05 +0300 Subject: [PATCH] Create hud_lib_test.txt --- libs/exemples/hud_lib_test.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 libs/exemples/hud_lib_test.txt diff --git a/libs/exemples/hud_lib_test.txt b/libs/exemples/hud_lib_test.txt new file mode 100644 index 0000000..8bd4e1e --- /dev/null +++ b/libs/exemples/hud_lib_test.txt @@ -0,0 +1,20 @@ +--@name +--@client +--@owneronly + +local myWindow = createWindow("Window", 100, 100, 300, 200) +addChild(myWindow, createLabel("Hello world!", 20, 50)) +addChild(myWindow, createButton("Ok", 20, 100, 100, 30, function() + myWindow.draw = false + input.enableCursor(false) +end)) + +hook.add("think", "toggleWindowOnInsert", function() + if input.wasKeyPressed(KEY.INSERT) then + toggleWindow(myWindow) + end +end) + +hook.add("render", "drawMyWindow", function() + drawWindow(myWindow) +end)