Panel.LocalToScreen

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:LocalToScreen( )
Description:
Find the position of the panel, local to the screen and given coordinates.
Returns: Int X, Int Y
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.LocalToScreen]Panel.LocalToScreen [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionFind the position of the panel on the screen.
Used onNewerClient.png
Code
 
local Frame = vgui.Create( "DFrame" )
Frame:SetSize( 200, 200 )
Frame:SetPos( 50, 50 )
Frame:MakePopup( )
 
local X, Y = Frame:LocalToScreen( 0, 0 ) // Find our position compared to 0, 0 on the screen ( top left corner )
 
MsgN( "Frame X: " .. X .. ", Frame Y: " .. Y )
 
OutputFrame X: 50, Frame Y: 50


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox