Garry's Mod Wiki

Revision Difference

derma.SkinHook#564534

<function name="SkinHook" parent="derma" type="libraryfunc"> <description>Calls the specified hook for the given panel</description> <realm>Client and Menu</realm> <file line="192-L202">lua/derma/derma.lua</file> <args> <arg name="type" type="string">The type of hook to run</arg> <arg name="name" type="string">The name of the hook to run</arg> <arg name="panel" type="Panel">The panel to call the hook for</arg> <arg name="vararg1" type="any" default="nil">First parameter for the panel hook. i.e. width of the panel for <page text="Paint">PANEL:Paint</page> hooks.</arg> <arg name="vararg2" type="any" default="nil">Second parameter for the panel hook. i.e. height of the panel for <page text="Paint">PANEL:Paint</page> hooks.</arg> <arg name="vararg3" type="any" default="nil">Third parameter for the panel hook.</arg> <arg name="vararg4" type="any" default="nil">Fourth parameter for the panel hook.</arg> </args> <rets> <ret name="" type="any">The returned variable from the skin hook</ret> </rets> </function> ⤶ ⤶ <example name="Basic Usage">⤶ <description> Example usage from `dbutton.lua` </description>⤶ <code name="dbutton's paint function">⤶ function PANEL:Paint( w, h )⤶ derma.SkinHook( "Paint", "Button", self, w, h )⤶ ...⤶ end⤶ </code>⤶ <code name="Resulting function call in default skin">⤶ function SKIN:PaintButton( panel, w, h )⤶ ...⤶ end⤶ </code>⤶ ⤶ </example>⤶