Garry's Mod Wiki

Revision Difference

vgui.RegisterFile#546688

<function name="RegisterFile" parent="vgui" type="libraryfunc"> <description>Registers a new VGUI panel from a file.</description>⤶ <description>Registers a new <page>VGUI</page> panel from a file, to be used with <page>vgui.CreateFromTable</page>.⤶ ⤶ File file must use the `PANEL` global that is provided just before the file is <page>Global.include</page>d, for example:⤶ ⤶ ⤶ ```⤶ PANEL.Base = "Panel"⤶ ⤶ function PANEL:Init()⤶ -- Your code...⤶ end⤶ ⤶ function PANEL:Think()⤶ -- Your code...⤶ end⤶ ```⤶ ⤶ </description>⤶ <realm>Client and Menu</realm> <file line="109-126">lua/includes/extensions/client/panel/scriptedpanels.lua</file> <args> <arg name="file" type="string">The file to register</arg> </args> <rets> <ret name="" type="table">A table containing info about the panel. Can be supplied to <page>vgui.CreateFromTable</page></ret>⤶ <ret name="" type="table">A table containing info about the panel.</ret>⤶ </rets> </function>