> For the complete documentation index, see [llms.txt](https://docs.rlib.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rlib.io/dev/references/uclass/draw.md).

# draw

CLIENT

`:draw(` [**ᶠᵘⁿᶜ**](https://wiki.facepunch.com/gmod/function)  fn`)`

## ▸ Parameters

&#x20;     ***`fn`**`    ``func`*\
&#x20;                            function executed

## ▸ Alias

&#x20;     *`draw, paint`*

## ▸ Description

&#x20;        Overrides panel Paint function

## ▸ Notes

&#x20;        Calls [**uclass.nodraw( )**](/dev/references/uclass/nodraw.md) before specified function

## ▸ Example

{% tabs %}
{% tab title="Example 1" %}

```lua
self            = ui.get( self                          )
                :draw( function( s, w, h )
                    design.rbox( 4, 1, 4, w - 2, h - 4, color_white )
                end )
```

{% endtab %}

{% tab title="Example 2" %}

```lua
self.pnl        = ui.new( 'pnl', self.parent            )
:static         ( LEFT                                  )

                :draw( function( s, w, h )
                    design.rbox( 4, 1, 4, w - 2, h - 4, color_white )
                end )
```

{% endtab %}
{% endtabs %}

## ▸ Associations

&#x20;      [**nodraw**](/dev/references/uclass/nodraw.md)**,** [**savedraw**](/dev/references/uclass/savedraw.md)
