---
description: Functions for drawing. Won't work outside 'OnRender' function.
---

# Renderer

### Static Functions:

#### .GetScreenSize

`Renderer.GetScreenSize()`: Vector2

Returns Vector2 object with screen size.

### Functions:

#### .SetRounding

`Renderer.SetRounding(value: integer, tl: boolean, tr: boolean, bl: boolean, br: boolean)`

| Argument | Type    | Description           |
| -------- | ------- | --------------------- |
| value    | integer | Rounding value        |
| tl       | boolean | Top-Left rounding     |
| tr       | boolean | Top-Right rounding    |
| bl       | boolean | Bottom-Left rounding  |
| br       | boolean | Bottom-Right rounding |

Sets rounding flags for current frame.

#### .SetThickness

`Renderer.SetThickness(value: integer)`

| Argument | Type    | Description     |
| -------- | ------- | --------------- |
| value    | integer | Thickness value |

Sets thickness value for current frame.

#### .SetTextAlign

`Renderer.SetTextAlign(value: integer)`

| Argument | Type    | Description                                               |
| -------- | ------- | --------------------------------------------------------- |
| value    | integer | <p>Align type:<br>0 - Left<br>1 - Center<br>2 - Right</p> |

Sets text align for current frame.

#### .AddLine

`Renderer.AddLine(from: Vector2, to: Vector2, color: Color)`

| Argument | Type    | Description                  |
| -------- | ------- | ---------------------------- |
| from     | Vector2 | Screen coordinate of point A |
| to       | Vector2 | Screen coordinate of point B |
| color    | Color   | Color object                 |

Draws a line from point A to point B.

#### .AddRect

`Renderer.AddRect(from: Vector2, to: Vector2, color: Color)`

| Argument | Type    | Description                  |
| -------- | ------- | ---------------------------- |
| from     | Vector2 | Screen coordinate of point A |
| to       | Vector2 | Screen coordinate of point B |
| color    | Color   | Color object                 |

Draws a rect from point A to point B.

#### .AddRectFilled

`Renderer.AddRectFilled(from: Vector2, to: Vector2, color: Color)`

| Argument | Type    | Description                  |
| -------- | ------- | ---------------------------- |
| from     | Vector2 | Screen coordinate of point A |
| to       | Vector2 | Screen coordinate of point B |
| color    | Color   | Color object                 |

Draws a filled rect from point A to point B.

#### .AddImage

`Renderer.AddImage(image: Image, position: Vector2, size: Vector2, color: Color)`

| Argument | Type               | Description       |
| -------- | ------------------ | ----------------- |
| image    | Image              | Image object      |
| position | Vector2            | Screen coordinate |
| size     | Vector2 (optional) | Image Size        |
| color    | Color (optional)   | Color object      |

Draws a image.

#### .AddText

`Renderer.AddText(font: Font, position: Vector2, color: Color, text: string)`

| Argument | Type    | Description             |
| -------- | ------- | ----------------------- |
| font     | Font    | Font object             |
| position | Vector2 | Screen coordinate       |
| color    | Color   | Color object            |
| text     | string  | Text that will be drawn |

Draws a text.

#### .AddTextShadow

`Renderer.AddTextShadow(font: Font, position: Vector2, color: Color, text: string)`

| Argument | Type    | Description             |
| -------- | ------- | ----------------------- |
| font     | Font    | Font object             |
| position | Vector2 | Screen coordinate       |
| color    | Color   | Color object            |
| text     | string  | Text that will be drawn |

Draws a text with shadow.
