Panel/CursorPos

From Garry's Mod
Jump to: navigation, search
 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.

WARNING

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

number

X coordinate of the cursor, relative to the top left of the panel.

Returns

number

Y coordinate of the cursor, relative to the top left of the panel.
Personal tools
Navigation