[N]irvana Posted July 20, 2013 Share Posted July 20, 2013 How i can start cursor in my panel? And stop cursor when press f9? Link to comment
[N]irvana Posted July 20, 2013 Author Share Posted July 20, 2013 showCursor bindKey You can create example please? (no use wiki) Link to comment
WASSIm. Posted July 20, 2013 Share Posted July 20, 2013 local window = guiCreateWindow ( 400, 100, 100, 100, "test", false ) guiSetVisible (window,false) bindKey ("F2", "down", -- key show windows function ( ) if ( guiGetVisible ( window ) == true ) then guiSetVisible ( window, false ) else guiSetVisible ( window, true ) showCursor (true) end end ) bindKey ("F9", "down", --key stop cursor function ( ) showCursor (false) end ) Link to comment
[N]irvana Posted July 20, 2013 Author Share Posted July 20, 2013 I have my panel This is my client.lua local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() function dxDrawTheImage ( ) if isPlayerViewingPanel then dxDrawImage (240, 145, 550, 480, "window.png" ) dxDrawText ( "Rules", sw/2 - 26, sh/2 - 230, sw/2 + 175, sh/2 + 80, tocolor ( 255, 255, 255, 255 ), 1.6, "default-bold") end end addEventHandler ( "onClientRender", root, dxDrawTheImage ) bindKey("f6", "down",function() isPlayerViewingPanel = not isPlayerViewingPanel end) I want to make this function Press f6 (Open Panel) start cursor, Press f6 (Close Panel) stop cursor? (I am very noob in this) Link to comment
WASSIm. Posted July 20, 2013 Share Posted July 20, 2013 local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() function dxDrawTheImage ( ) if isPlayerViewingPanel then dxDrawImage (240, 145, 550, 480, "window.png" ) dxDrawText ( "Rules", sw/2 - 26, sh/2 - 230, sw/2 + 175, sh/2 + 80, tocolor ( 255, 255, 255, 255 ), 1.6, "default-bold") end end addEventHandler ( "onClientRender", root, dxDrawTheImage ) bindKey("f6", "down",function() if ( isPlayerViewingPanel == true ) then isPlayerViewingPanel = false showCursor (false) else isPlayerViewingPanel = true showCursor (true) end end ) Link to comment
[N]irvana Posted July 20, 2013 Author Share Posted July 20, 2013 local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() function dxDrawTheImage ( ) if isPlayerViewingPanel then dxDrawImage (240, 145, 550, 480, "window.png" ) dxDrawText ( "Rules", sw/2 - 26, sh/2 - 230, sw/2 + 175, sh/2 + 80, tocolor ( 255, 255, 255, 255 ), 1.6, "default-bold") end end addEventHandler ( "onClientRender", root, dxDrawTheImage ) bindKey("f6", "down",function() if ( isPlayerViewingPanel == true ) then isPlayerViewingPanel = false showCursor (false) else isPlayerViewingPanel = true showCursor (true) end end ) I appreciate your help, people like you there few Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now