Panel:PaintManual

From Garry's Mod
Jump to: navigation, search
 Panel:PaintManual( )

Description

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

Examples

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.
panel paintmanual example1 output.png
(click for higher resolution)
Personal tools
Navigation