Panel.Paint
From GMod Wiki
(Redirected from DForm.Paint)
Event Hook | |
Hook Name | Paint |
Syntax | PANEL:Paint( ) |
Description | This is a 2D Rendering Hook. This is called every time the panel needs to be drawn. |
Returns | Boolean |
Lua State | |
BBCode | [b][url=wiki.garrysmod.com/?title=Panel.Paint]Panel.Paint [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
- Panels are like sticky labels - you draw on the label and then put it on the screen. That being said, drawing something at 0,0 would cause it to appear at 0,0 on the PANEL, not the screen! Even cooler, if you draw outside of the panel, it won't overflow onto the screen. Instead, it will be clipped off. You can only draw on the panel - not outside of it.
- Returning true to this will override the base panel's drawing function. For example, if your panel is based off of a button, returning true will tell the button that you don't want to see that old, gray and white button. Instead, we'll be doing our own artwork. If you want to draw over the default panel, keeping the original panel art work, use Panel:PaintOver()
- This is only called when the panel is visible.