Garry's Mod Wiki

gui

The gui library is similar to the input but features functions that are more focused on the mouse's interaction with GUI panels.

Methods

gui.ActivateGameUI()
Opens the game menu overlay.
gui.EnableScreenClicker( boolean enabled )
Enables the mouse cursor without restricting player movement, like using Sandbox's context menu. Some CUserCmd functions will return incorrect values when this function is active.
gui.HideGameUI()
Hides the game menu overlay.
gui.InternalCursorMoved( number deltaX, number deltaY )
Simulates a mouse move with the given deltas.
gui.InternalKeyCodePressed( number key )
Simulates a key press for the given key.
gui.InternalKeyCodeReleased( number key )
Simulates a key release for the given key.
gui.InternalKeyCodeTyped( number key )
Simulates a key type typing to the specified key.
gui.InternalKeyTyped( number code )
Simulates an ASCII symbol writing. Use to write text in the chat or in VGUI. Doesn't work while the main menu is open!
gui.InternalMouseDoublePressed( number key )
Simulates a double mouse key press for the given mouse key.
gui.InternalMousePressed( number key )
Simulates a mouse key press for the given mouse key.
gui.InternalMouseReleased( number key )
Simulates a mouse key release for the given mouse key.
gui.InternalMouseWheeled( number delta )
Simulates a mouse wheel scroll with the given delta.
boolean gui.IsConsoleVisible()
Returns whether the console is visible or not.
boolean gui.IsGameUIVisible()
Returns whenever the game menu overlay ( main menu ) is open or not.
number, number gui.MousePos()
We advise against using this. It may be changed or removed in a future update. Use input.GetCursorPos instead. Returns the cursor's position on the screen, or 0, 0 if cursor is not visible.
number gui.MouseX()
Returns x component of the mouse position.
number gui.MouseY()
Returns y component of the mouse position.
gui.OpenURL( string url )
Opens specified URL in the steam overlay browser. The URL has to start with either http:// or https:// When called clientside, user will be asked for confirmation before the website will open.You can't click the confirmation if a model panel has focus.Issue Tracker: 3383Will silently fail if the URL is more than 512 characters long.Issue Tracker: 4663
Vector gui.ScreenToVector( number x, number y )
Converts the specified screen position to a direction vector local to the player's view. A related function is Vector:ToScreen, which translates a 3D position to a screen coordinate. util.AimVector is a more generic version of this, using a custom view instead of the player's current view.
gui.SetMousePos( number mouseX, number mouseY )
We advise against using this. It may be changed or removed in a future update. Use input.SetCursorPos instead. Sets the cursor's position on the screen, relative to the topleft corner of the window
gui.ShowConsole()
Shows console in the game UI.

Page Links


Special Pages


Wikis

?

Render Time: 31ms

DB GetPage 3
Generate Html 4
SaveChanges (1) 10
Render Body 0
Render Sidebar 12