sabodden
Member
- Joined
- Sep 27, 2019
- Messages
- 138
- Reaction score
- 18
How to when player press X button
Make the window hide calling the function OnOff just as the hotkey...
Make the window hide calling the function OnOff just as the hotkey...
Code:
function init()
mainWindow = nil
mainButton = nil
g_keyboard.bindKeyDown('Shift+F12', onoff)
mainWindow = g_ui.displayUI('main.otui')
mainWindow:hide()
mainWindow:recursiveGetChildById('minimizeButton'):hide()
end
function terminate()
g_keyboard.unbindKeyDown('Shift+F12')
mainWindow:hide()
end
function onoff()
if mainWindow:isVisible() then
mainWindow:hide()
else
mainWindow:breakAnchors()
mainWindow:show()
end
end