Panel.PaintOver

From GMod Wiki

(Redirected from P.PaintOver)
Jump to: navigation, search
Event Hook
Hook NamePaintOver
SyntaxPANEL:PaintOver( )
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.PaintOver]Panel.PaintOver [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:PaintOver()
    draw.SimpleText("Hello!","DefaultSmall",0,0,Color(0,0,0,255))
end
 
OutputDraw text Hello! at Position x0,y0 of the Panel. Without over riding the default Panel:Paint()


DescriptionAnother way of how it can be called. More commonly seen like this.
Used onNewerClient.png
Code
 
PANEL.PaintOver = 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