Panel.Paint

From GMod Wiki

(Redirected from P.Paint)
Jump to: navigation, search
Event Hook
Hook NamePaint
SyntaxPANEL:Paint( )
DescriptionThis is a 2D Rendering Hook. This is called every time the panel needs to be drawn.
ReturnsBoolean
Lua StateNewerClient.png
BBCode[b][url=wiki.garrysmod.com/?title=Panel.Paint]Panel.Paint [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]

Examples

DescriptionDraw some text in the upper-left corner of the panel.
Used onNewerClient.png
Code
function PANEL:Paint()
    draw.SimpleText("Hello!","DefaultSmall",0,0,Color(0,0,0,255))
end
OutputDraw text Hello! at Position x0,y0 of the Panel.


DescriptionAnother way of how it can be called. More commonly seen like this.
Used onNewerClient.png
Code
PANEL.Paint = function()
    draw.SimpleText("Hello!","DefaultSmall",0,0,Color(0,0,0,255))
end
OutputSame output as above example.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox