> For the complete documentation index, see [llms.txt](https://lua.legacy.fatality.win/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lua.legacy.fatality.win/fatality/render.md).

# Render

fatality.render

## Functions

### rect\_filled

draws a filled rectangle

`render:rect_filled( x, y, w, h, color )`

| Parameter |                Data type               |    Description   |
| :-------: | :------------------------------------: | :--------------: |
|     x     |                 integer                |   x coordinate   |
|     y     |                 integer                |   y coordinate   |
|     w     |                 integer                |  rectangle width |
|     h     |                 integer                | rectangle height |
|   color   | [csgo.color](/csgo/datatypes/color.md) |  rectangle color |

### rect

draws a rectangle outline

`render:rect( x, y, w, h, color )`

| Parameter |                Data type               |    Description   |
| :-------: | :------------------------------------: | :--------------: |
|     x     |                 integer                |   x coordinate   |
|     y     |                 integer                |   y coordinate   |
|     w     |                 integer                |  rectangle width |
|     h     |                 integer                | rectangle height |
|   color   | [csgo.color](/csgo/datatypes/color.md) |  rectangle color |

### rect\_fade

draws a gradient rectangle

`render:rect_fade( x, y, w, h, color_one, color_two, horizontal )`

|  Parameter |                Data type               |        Description       |
| :--------: | :------------------------------------: | :----------------------: |
|      x     |                 integer                |       x coordinate       |
|      y     |                 integer                |       y coordinate       |
|      w     |                 integer                |      rectangle width     |
|      h     |                 integer                |     rectangle height     |
| color\_one | [csgo.color](/csgo/datatypes/color.md) |  first color of gradient |
| color\_two | [csgo.color](/csgo/datatypes/color.md) | second color of gradient |
| horizontal |                 boolean                | draw gradient horizontal |

### create\_font

creates a font. See [csgo.font](/csgo/datatypes/font.md)

`render:create_font( font_family, size, weight, outline )`

|   Parameter  | Data type |        Description       |
| :----------: | :-------: | :----------------------: |
| font\_family |   string  |    name of font family   |
|     size     |  integer  | height of font in pixels |
|    weight    |  integer  |     thickness of font    |
|    outline   |  boolean  |      use an outline      |

### text

draws a string of text at a position

`render:text( font, x, y, text , color )`

| Parameter |                                Data type                               |        Description       |
| :-------: | :--------------------------------------------------------------------: | :----------------------: |
|    font   | [csgo.font](https://jewls.gitbook.io/fatality-lua/csgo/datatypes/font) |        font to use       |
|     x     |                                 integer                                |       x coordinate       |
|     y     |                                 integer                                |       y coordinate       |
|    text   |                                 string                                 | string of text to render |
|   color   |           [csgo.color](/csgo/datatypes/color.md#constructor)           |       color to use       |

### text\_size

returns a [csgo.vector2](/csgo/datatypes/vector2.md) with the size of the text in pixels

`render:text_size( font, text )`

| Parameter |               Data type              |        Description        |
| :-------: | :----------------------------------: | :-----------------------: |
|    font   | [csgo.font](/csgo/datatypes/font.md) |        font to use        |
|    text   |                string                | string of text to measure |

### indicator

draws an indicator&#x20;

`render:indicator( x, y, text, active, bar_progress )`

|   Parameter   | Data type |                           Description                          |
| :-----------: | :-------: | :------------------------------------------------------------: |
|       x       |  integer  |                          x coordinate                          |
|       y       |  integer  |                          y coordinate                          |
|      text     |   string  |                     string of text to draw                     |
|     active    |  boolean  |                            is active                           |
| bar\_progress |   float   | <p>value of bar progress ( 0 - 1 ) </p><p>or -1 for no bar</p> |

### screen\_size

returns a  [csgo.vector2](/csgo/datatypes/vector2.md) with the game window's width and height

`render:screen_size( )`

### draw\_hitgroup

draws a players hitbox matrix

`render:draw_hitgroup( player, matrix, hitgroup, duration, color)`

| Parameter |                     Data type                     |                      Description                      |
| :-------: | :-----------------------------------------------: | :---------------------------------------------------: |
|   player  |      [csgo.player](/csgo/datatypes/player.md)     |                     player to draw                    |
|   matrix  | [csgo.matrix3x4\_t](/csgo/datatypes/matrix3x4.md) |                     matrix to use                     |
|  hitgroup |                      integer                      | <p>hitgroup to draw </p><p>or -1 for all hitboxes</p> |
|  duration |                       float                       |                    how long to draw                   |
|   color   |       [csgo.color](/csgo/datatypes/color.md)      |                      color to use                     |
