# Render

### Enums <a href="#enums" id="enums"></a>

Font flagsRect roundingText alignmentEasings

### Datatypes <a href="#datatypes" id="datatypes"></a>

#### color <a href="#color" id="color"></a>

render.color(255, 255, 255)render.color(255, 255, 255, 100)render.color("#FFFFFF")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Default Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| r                                                                                    | number                                                                              | red channel (0-255)                                                                    | ❌                                                                                        |
| g                                                                                    | number                                                                              | green channel (0-255)                                                                  | ❌                                                                                        |
| b                                                                                    | number                                                                              | blue channel (0-255)                                                                   | ❌                                                                                        |
| a                                                                                    | number                                                                              | alpha channel (0-255)                                                                  | 255                                                                                      |

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| hex\_code                                                                            | string                                                                              | hex color code                                                                         |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| table with rgba values                                                           | table                                                                               |

**Table structure:**

{ r, g, b, a }

#### esp\_flag <a href="#esp_flag" id="esp_flag"></a>

render.esp\_flag("some flag", render.color("#FFFFFF"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​           | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| text                                                                                 | string                                                                                        | flag to draw                                                                           |
| color                                                                                | ​[render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ | color to draw                                                                          |

### Fonts <a href="#fonts" id="fonts"></a>

#### create\_font <a href="#create_font" id="create_font"></a>

render.create\_font("smallest\_pixel-7.ttf", 11, render.font\_flag\_outline)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                     | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Default Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| font\_path                                                                           | string                                                                                                  | path to font or name of font                                                           | ❌                                                                                        |
| size                                                                                 | number                                                                                                  | font size                                                                              | ❌                                                                                        |
| flags                                                                                | ​[render.font\_flag](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#font-flags)​ | font flag                                                                              | 0                                                                                        |
| from                                                                                 | number                                                                                                  | minimum [codepoint](https://en.wikipedia.org/wiki/Code_point)​                         | 0                                                                                        |
| to                                                                                   | number                                                                                                  | maximum [codepoint](https://en.wikipedia.org/wiki/Code_point)​                         | 255                                                                                      |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| font id                                                                          | number                                                                              |

#### create\_font\_gdi <a href="#create_font_gdi" id="create_font_gdi"></a>

render.create\_font\_gdi("Smallest pixel-7", 11, render.font\_flag\_outline)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                     | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Default Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| font\_path                                                                           | string                                                                                                  | path to font or name of font                                                           | ❌                                                                                        |
| size                                                                                 | number                                                                                                  | font size                                                                              | ❌                                                                                        |
| flags                                                                                | ​[render.font\_flag](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#font-flags)​ | font flag                                                                              | 0                                                                                        |
| from                                                                                 | number                                                                                                  | minimum [codepoint](https://en.wikipedia.org/wiki/Code_point)​                         | 0                                                                                        |
| to                                                                                   | number                                                                                                  | maximum [codepoint](https://en.wikipedia.org/wiki/Code_point)​                         | 255                                                                                      |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| font id                                                                          | number                                                                              |

#### create\_font\_stream <a href="#create_font_stream" id="create_font_stream"></a>

render.create\_font\_stream({0x1, ...}, 12)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                     | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Default Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| bytes                                                                                | table                                                                                                   | table of bytes                                                                         | ❌                                                                                        |
| size                                                                                 | number                                                                                                  | font size                                                                              | ❌                                                                                        |
| flags                                                                                | ​[render.font\_flag](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#font-flags)​ | font flag                                                                              | 0                                                                                        |
| from                                                                                 | number                                                                                                  | minimum [codepoint](https://en.wikipedia.org/wiki/Code_point)​                         | 0                                                                                        |
| to                                                                                   | number                                                                                                  | maximum [codepoint](https://en.wikipedia.org/wiki/Code_point)​                         | 255                                                                                      |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| font id                                                                          | number                                                                              |

#### get\_text\_size <a href="#get_text_size" id="get_text_size"></a>

​render.get\_text\_size(font, "String to measure")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                 |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| font                                                                                 | number                                                                              | font id from [render.create\_font](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#create_font)​ |
| text                                                                                 | string                                                                              | string to measure                                                                                                      |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| width                                                                            | number                                                                              |
| height                                                                           | number                                                                              |

### Textures <a href="#textures" id="textures"></a>

#### create\_texture <a href="#create_texture" id="create_texture"></a>

render.create\_texture("fatality/image.jpg")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| texture\_path                                                                        | string                                                                              | path to texture                                                                        |

**Supported image formats:**

* JPEG
* PNG
* BMP
* GIF (non-animated)
* TGA
* PSD
* HDR
* PIC
* PNM (binary only)

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| texture id                                                                       | number                                                                              |

#### create\_texture\_bytes <a href="#create_texture_bytes" id="create_texture_bytes"></a>

render.create\_texture\_bytes(bytes, 20)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| bytes                                                                                | unsigned char\*                                                                     | array of bytes                                                                         |
| size                                                                                 | number                                                                              | texture size                                                                           |

**Supported Image Formats:**

* JPEG
* PNG
* BMP
* GIF (non-animated)
* TGA
* PSD
* HDR
* PIC
* PNM (binary only)

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| texture id                                                                       | number                                                                              |

**Note:**

This function can only be used by utilizing the ffi library as it requires a byte array. One way to do such would be using [ISteamUtils::GetImageRGBA](https://partner.steamgames.com/doc/api/ISteamUtils#GetImageRGBA).

#### create\_texture\_rgba <a href="#create_texture_rgba" id="create_texture_rgba"></a>

render.create\_texture\_rgba(bytes, 100, 100, row\_stride)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| bytes                                                                                | unsigned char\*                                                                     | array of bytes                                                                         |
| w                                                                                    | number                                                                              | texture width                                                                          |
| h                                                                                    | number                                                                              | texture height                                                                         |
| row\_stride                                                                          | number                                                                              | number of bytes in each row (image width \* 4)                                         |

**Supported Image Formats:**

* JPEG
* PNG
* BMP
* GIF (non-animated)
* TGA
* PSD
* HDR
* PIC
* PNM (binary only)

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| texture id                                                                       | number                                                                              |

**Note:**

This function can only be used by utilizing the ffi library as it requires a byte array. One way to do such would be using [ISteamUtils::GetImageRGBA](https://partner.steamgames.com/doc/api/ISteamUtils#GetImageRGBA).

#### create\_texture\_stream <a href="#create_texture_stream" id="create_texture_stream"></a>

render.create\_texture\_stream({0x1, 0x5, 0xff})

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| byte\_stream                                                                         | table of bytes                                                                      | texture bytes                                                                          |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| texture id                                                                       | number                                                                              |

#### create\_texture\_svg <a href="#create_texture_svg" id="create_texture_svg"></a>

local svg\_data =\[\[\<svg style="width:24px;height:24px" viewBox="0 0 24 24">\<path fill="#ffffff" d="M12.89,3L14.85,3.4L11.11,21L9.15,20.6L12.89,3M19.59,12L16,8.41V5.58L22.42,12L16,18.41V15.58L19.59,12M1.58,12L8,5.58V8.41L4.41,12L8,15.58V18.41L1.58,12Z" />\</svg>]]render.create\_texture\_svg(svg\_data, 20)-- orrender.create\_texture\_svg("fatality/image.svg", 20)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| image                                                                                | string                                                                              | svg data or svg file path                                                              |
| target\_height                                                                       | number                                                                              | desired image height                                                                   |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| texture id                                                                       | number                                                                              |

#### push\_texture <a href="#push_texture" id="push_texture"></a>

local texture\_id = render.create\_texture("image.png")render.push\_texture(texture\_id)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| texture\_id                                                                          | number                                                                              | texture id returned from render.create\_texture                                        |

**Usage:**

Pushes a texture used by render functions.Make sure to follow the call with [render.pop\_texture](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#pop_texture)!Failure to do so will result in undefined behavior!

#### pop\_texture <a href="#pop_texture" id="pop_texture"></a>

render.pop\_texture()

**Usage:**

Pops a previously used texture

#### push\_uv <a href="#push_uv" id="push_uv"></a>

render.push\_uv(0.25, 0.25, 0.75, 0.75)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | min x coord (0 - 1)                                                                    |
| y1                                                                                   | number                                                                              | min y coord (0 - 1)                                                                    |
| x2                                                                                   | number                                                                              | max x coord (0 - 1)                                                                    |
| y2                                                                                   | number                                                                              | max y coord (0 - 1)                                                                    |

**Usage:**

Adjusts texture coordinates. Use after calling [render.push\_texture](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#push_texture).Make sure to follow the call with [render.pop\_uv](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#pop_uv)!Failure to do so will result in undefined behavior!

#### pop\_uv <a href="#pop_uv" id="pop_uv"></a>

render.pop\_uv()

**Usage:**

Pops a previously used set of texture coordinates.

#### get\_texture\_size <a href="#get_texture_size" id="get_texture_size"></a>

​render.get\_texture\_size(texture\_id)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                   |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| texture\_id                                                                          | number                                                                              | texture id from [create\_texture](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#create_texture)​ |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| width                                                                            | number                                                                              |
| height                                                                           | number                                                                              |

### Drawing <a href="#drawing" id="drawing"></a>

#### push\_clip\_rect <a href="#push_clip_rect" id="push_clip_rect"></a>

render.push\_clip\_rect(10, 10, 110, 110)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Default Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | min x point                                                                            | ❌                                                                                        |
| y1                                                                                   | number                                                                              | min y point                                                                            | ❌                                                                                        |
| x2                                                                                   | number                                                                              | max x point                                                                            | ❌                                                                                        |
| x2                                                                                   | number                                                                              | max y point                                                                            | ❌                                                                                        |
| intersect                                                                            | boolean                                                                             | should it intersect with existing clip rects                                           | false                                                                                    |

**Usage:**

Pushes a clip rect so elements can only be drawn within the rect.Make sure to follow the call with [render.pop\_clip\_rect](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#pop_clip_rect)!Failure to do so will result in undefined behavior!

#### pop\_clip\_rect <a href="#pop_clip_rect" id="pop_clip_rect"></a>

render.pop\_clip\_rect()

**Usage:**

Pops a previously used clip rect

#### get\_screen\_size <a href="#get_screen_size" id="get_screen_size"></a>

render.get\_screen\_size()

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| width                                                                            | number                                                                              |
| height                                                                           | number                                                                              |

#### rect\_filled <a href="#rect_filled" id="rect_filled"></a>

render.rect\_filled(10, 10, 110, 110, render.color("#00FFFF"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | min x point                                                                                                           |
| y1                                                                                   | number                                                                              | min y point                                                                                                           |
| x2                                                                                   | number                                                                              | max x point                                                                                                           |
| y2                                                                                   | number                                                                              | max y point                                                                                                           |
| color                                                                                | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |

**Usage:**

Draws a filled rectangle. Use [render.push\_texture](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#push_texture) to apply a texture to the shape.

#### rect <a href="#rec" id="rec"></a>

render.rect(10, 10, 110, 110, render.color("#00FFFF"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | min x point                                                                                                           |
| y1                                                                                   | number                                                                              | min y point                                                                                                           |
| x2                                                                                   | number                                                                              | max x point                                                                                                           |
| y2                                                                                   | number                                                                              | max y point                                                                                                           |
| color                                                                                | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |

#### rect\_filled\_rounded <a href="#rect_filled-1" id="rect_filled-1"></a>

render.rect\_filled\_rounded(10, 10, 110, 110, render.color("#00FFFF"), 1.5, render.top)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                | ​[Default Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​        |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | min x point                                                                                                           | ❌                                                                                               |
| y1                                                                                   | number                                                                              | min y point                                                                                                           | ❌                                                                                               |
| x2                                                                                   | number                                                                              | max x point                                                                                                           | ❌                                                                                               |
| y2                                                                                   | number                                                                              | max y point                                                                                                           | ❌                                                                                               |
| color                                                                                | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ | ❌                                                                                               |
| rounding                                                                             | number                                                                              | amount of rounding                                                                                                    | ❌                                                                                               |
| rounding\_flags                                                                      | number                                                                              | corners to round                                                                                                      | ​[render.all](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#undefined)​ |

**Usage:**

Draws a filled rounded rectangle. Use [render.push\_texture](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#push_texture) to apply a texture to the shape.

#### rect\_filled\_multicolor <a href="#rect_filled_multicolor" id="rect_filled_multicolor"></a>

render.rect\_filled\_multicolor(10, 10, 110, 110,render.color("#FFFFFF"), render.color("#000000"),render.color("#FFFFFF"), render.color("#000000"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | min x point                                                                                                           |
| y1                                                                                   | number                                                                              | min y point                                                                                                           |
| x2                                                                                   | number                                                                              | max x point                                                                                                           |
| y2                                                                                   | number                                                                              | max y point                                                                                                           |
| top\_left                                                                            | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |
| top\_right                                                                           | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |
| bottom\_right                                                                        | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |
| bottom\_left                                                                         | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |

**Usage:**

Draws a multi-color rectangle.

#### circle\_filled <a href="#circle_filled" id="circle_filled"></a>

render.circle\_filled(110, 110, 50, render.color("#FFFFFF"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                | ​[Default Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| x                                                                                    | number                                                                              | center x point                                                                                                        | ❌                                                                                        |
| y                                                                                    | number                                                                              | center y point                                                                                                        | ❌                                                                                        |
| radius                                                                               | number                                                                              | the circles radius                                                                                                    | ❌                                                                                        |
| color                                                                                | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ | ❌                                                                                        |
| segments                                                                             | number                                                                              | number of points (circle resolution)                                                                                  | 12                                                                                       |
| percentage                                                                           | number                                                                              | how much of the circle is drawn (0 - 1)                                                                               | 1                                                                                        |
| angle                                                                                | number                                                                              | circle rotation (0 - 360Draws a filled multi-color rectangle.)                                                        | 0                                                                                        |

**Usage:**

Draws a filled circle. Use [render.push\_texture](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#push_texture) to apply a texture to the shape.

#### circle <a href="#circle" id="circle"></a>

render.circle(110, 110, 50, render.color("#FFFFFF"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                | ​[Default Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| x                                                                                    | number                                                                              | center x point                                                                                                        | ❌                                                                                        |
| y                                                                                    | number                                                                              | center y point                                                                                                        | ❌                                                                                        |
| radius                                                                               | number                                                                              | the circles radius                                                                                                    | ❌                                                                                        |
| color                                                                                | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ | ❌                                                                                        |
| thickness                                                                            | number                                                                              | thickness of the circle in pixels                                                                                     | 1                                                                                        |
| segments                                                                             | number                                                                              | number of points (circle resolution)                                                                                  | 12                                                                                       |
| percentage                                                                           | number                                                                              | how much of the circle is drawn (0 - 1)                                                                               | 1                                                                                        |
| angle                                                                                | number                                                                              | circle rotation (0 - 360)                                                                                             | 0                                                                                        |

#### line <a href="#line" id="line"></a>

render.line(10, 10, 100, 100, render.color("#FFFFFF"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | first x coord                                                                                                         |
| y1                                                                                   | number                                                                              | first y coord                                                                                                         |
| x2                                                                                   | number                                                                              | second x coord                                                                                                        |
| y2                                                                                   | number                                                                              | second y coord                                                                                                        |
| color                                                                                | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |

#### line\_multicolor <a href="#line_multicolor" id="line_multicolor"></a>

render.line\_multicolor(10, 10, 100, 100,render.color("#FFFFFF"), render.color("#000000"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | first x coord                                                                                                         |
| y1                                                                                   | number                                                                              | first y coord                                                                                                         |
| x2                                                                                   | number                                                                              | second x coord                                                                                                        |
| y2                                                                                   | number                                                                              | second y coord                                                                                                        |
| color                                                                                | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |
| color2                                                                               | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |

#### triangle\_filled <a href="#triangle_filled" id="triangle_filled"></a>

render.triangle\_filled(20, 10, 5, 20, 30, 20, render.color("#FFFFFF"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | first x coord                                                                                                         |
| y1                                                                                   | number                                                                              | first y coord                                                                                                         |
| x2                                                                                   | number                                                                              | second x coord                                                                                                        |
| y2                                                                                   | number                                                                              | second y coord                                                                                                        |
| x3                                                                                   | number                                                                              | third x coord                                                                                                         |
| y3                                                                                   | number                                                                              | third y coord                                                                                                         |
| color                                                                                | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |

**Usage:**

Draws a filled triangle. Use [render.push\_texture](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#push_texture) to apply a texture to the shape.

#### triangle <a href="#triangle" id="triangle"></a>

render.triangle(20, 10, 5, 20, 30, 20, render.color("#FFFFFF"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | first x coord                                                                                                         |
| y1                                                                                   | number                                                                              | first y coord                                                                                                         |
| x2                                                                                   | number                                                                              | second x coord                                                                                                        |
| y2                                                                                   | number                                                                              | second y coord                                                                                                        |
| x3                                                                                   | number                                                                              | third x coord                                                                                                         |
| y3                                                                                   | number                                                                              | third y coord                                                                                                         |
| color                                                                                | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |

#### triangle\_filled\_multicolor <a href="#triangle_filled_multicolor" id="triangle_filled_multicolor"></a>

render.triangle\_filled\_multicolor(20, 10, 5, 20, 30, 20,render.color("#FF0000"), render.color("#00FF00"), render.color("#0000FF"))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| x1                                                                                   | number                                                                              | first x coord                                                                                                         |
| y1                                                                                   | number                                                                              | first y coord                                                                                                         |
| x2                                                                                   | number                                                                              | second x coord                                                                                                        |
| y2                                                                                   | number                                                                              | second y coord                                                                                                        |
| x3                                                                                   | number                                                                              | third x coord                                                                                                         |
| y3                                                                                   | number                                                                              | third y coord                                                                                                         |
| color1                                                                               | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |
| color2                                                                               | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |
| color3                                                                               | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ |

#### text <a href="#text" id="text"></a>

render.text(font, 10, 10, "this is some centered text", render.color("#FFFFFF"), render.align\_center, render.align\_center))

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                                | ​[Default Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​                     |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| font                                                                                 | number                                                                              | font id(see [render.create\_font](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#create_font)) | ❌                                                                                                            |
| x                                                                                    | number                                                                              | first x coord                                                                                                         | ❌                                                                                                            |
| y                                                                                    | number                                                                              | first y coord                                                                                                         | ❌                                                                                                            |
| text                                                                                 | string                                                                              | text to draw                                                                                                          | ❌                                                                                                            |
| color                                                                                | table                                                                               | table of rgba values see [render.color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​ | ❌                                                                                                            |
| align\_horizontal                                                                    | number                                                                              | horizontal alignment type                                                                                             | ​[render.align\_left](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#text-alignment)​ |
| align\_vertical                                                                      | number                                                                              | vertical alignment type                                                                                               | ​[render.align\_top](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#text-alignment)​  |

**Pre-defined fonts:**

* font\_tab
* font\_control
* font\_esp
* font\_indicator

\-- Ex: render.font\_tab, render.font\_control

### Animations <a href="#animations" id="animations"></a>

#### create\_animator\_float <a href="#create_animator_float" id="create_animator_float"></a>

render.create\_animator\_float(0, 5, render.ease\_in\_out)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​              | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Default value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​         |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| initial\_value                                                                       | ​[color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​           | starting value                                                                         | ❌                                                                                                |
| duration                                                                             | number                                                                                           | how long to take in seconds                                                            | ❌                                                                                                |
| easing\_type                                                                         | ​[render.easing](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#easings)​ | the animation type                                                                     | ​[render.linear](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#easings)​ |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​  |
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| animator object                                                                  | ​[animator](https://jewls.gitbook.io/fatality-api/documentation/datatypes/animator)​ |

#### create\_animator\_color <a href="#create_animator_color" id="create_animator_color"></a>

render.create\_animator\_float(render.color("FFFFFF"), 5, render.ease\_in\_out, true)

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​              | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Default value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​         |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| initial\_value                                                                       | ​[color](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#color)​           | starting value                                                                         | ❌                                                                                                |
| duration                                                                             | number                                                                                           | how long to take in seconds                                                            | ❌                                                                                                |
| easing\_type                                                                         | ​[render.easing](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#easings)​ | the animation type                                                                     | ​[render.linear](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render#easings)​ |
| interpolate\_hue                                                                     | boolean                                                                                          | should the hue be animated                                                             | false                                                                                            |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/render)​  |
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| animator object                                                                  | ​[animator](https://jewls.gitbook.io/fatality-api/documentation/datatypes/animator)​ |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fecality-api.gitbook.io/docs/documentation/namespaces/render.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
