Garry's Mod Wiki

DisableClipping

  boolean DisableClipping( boolean disable )

Description

Sets whether rendering should be limited to being inside a panel or not. Needs to be used inside one of the 2d rendering hooks

See also Panel:NoClipping.

Arguments

1 boolean disable
Whether or not clipping should be disabled

Returns

1 boolean oldState
Whether the clipping was enabled or not before this function call

Example

Renders a white box outside of the panel

function PANEL:Paint() local old = DisableClipping( true ) draw.RoundedBox( 0, -50, -50, 25, 25, color_white ) DisableClipping( old ) end