Garry's Mod Wiki

Garry's Mod Wiki

  number, number Panel:CursorPos()

Description

Returns the cursor position relative to the top left of the panel.

This is equivalent to calling gui.MousePos and then Panel:ScreenToLocal.

This function uses a cached value for the screen position of the panel, computed at the end of the last VGUI Think/Layout pass.

ie. inaccurate results may be returned if the panel or any of its ancestors have been repositioned outside of PANEL:Think or PANEL:PerformLayout within the last frame.

Returns

1 number
X coordinate of the cursor, relative to the top left of the panel.
2 number
Y coordinate of the cursor, relative to the top left of the panel.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...