Garry's Mod Wiki

Revision Difference

Panel:LocalToScreen#562026

<function name="LocalToScreen" parent="Panel" type="classfunc"> <description>⤶ Gets the absolute screen position of the position specified relative to the panel.⤶ <description>⤶ ⤶ Takes X and Y coordinates relative to the panel and returns their corresponding positions relative to the screen.⤶ See also <page>Panel:ScreenToLocal</page>. <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, so inaccurate results may be returned if the panel or any of its ancestors have been re-positioned outside of <page>PANEL:Think</page> or <page>PANEL:PerformLayout</page> within the last frame.</warning> <note>If the panel uses <page>Panel:Dock</page>, this function will return 0, 0 when the panel was created. The position will be updated in the next frame.</note> </description>⤶ <realm>Client and Menu</realm>⤶ </description>⤶ ⤶ ⤶ ⤶ <realm>Client and Menu</realm>⤶ <args> <arg name="posX" type="number">The X coordinate of the position on the panel to translate.</arg> <arg name="posY" type="number">The Y coordinate of the position on the panel to translate.</arg> </args> <rets> <ret name="" type="number">The X coordinate relative to the screen.</ret> <ret name="" type="number">The Y coordinate relative to the screen.</ret> </rets> </function>