Update hud_lib_test.txt
This commit is contained in:
parent
c46ccd1494
commit
dbbec43ce9
1 changed files with 6 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue