Garry's Mod Wiki

Panel:PaintManual

  Panel:PaintManual( boolean unclamp = false )

Description

Paints the panel at its current position. To use this you must call Panel:SetPaintedManually(true).

Arguments

1 boolean unclamp = false
If set, overrides panels' clipping so that it can render fully when its size is larger than the game's resolution.

Example

Paints a simple panel inside a 3D rendering context.

local frame = vgui.Create( "DFrame" ) frame:SetTitle( "PaintManual Test" ) frame:SetSize( 500, 500 ) frame:SetPaintedManually( true ) hook.Add( "PostDrawTranslucentRenderables", "PaintManual Test", function() if IsValid(frame) then local eyePos = Entity(1):EyePos() local forward = Entity(1):GetForward() local forwardAngle = forward:Angle() cam.Start3D2D(eyePos + (forward * 250), Angle(0, forwardAngle.y - 90, forwardAngle.r + 90), 0.2) frame:PaintManual() cam.End3D2D() end end )
Output: The panel will be drawn facing the player located on the player's crosshair.