Garry's Mod Wiki

Panel:PaintManual

Panel:PaintManual()

Description

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

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.

Page Links


Special Pages


Wikis

?

Render Time: 35ms

DB GetPage 5
Generate Html 1
SaveChanges (1) 14
Render Body 0
Render Sidebar 12