Panel/LocalToScreen

From Garry's Mod
Jump to: navigation, search
 Panel:LocalToScreen( )

Contents

Description

Gets the absolute screen position of the position specified relative to the panel.

See also 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.

NOTE

If the panel uses Panel:Dock, this function will return 0, 0 when the panel was created. The position will be updated in the next frame.

Arguments

number posX

The X coordinate of the position on the panel to translate.

Arguments

number posY

The Y coordinate of the position on the panel to translate.

Returns

number

The X coordinate relative to the screen.

Returns

number

The Y coordinate relative to the screen.
Personal tools
Navigation