# Render

### Box\_Outline / OUTDATED

`MTools.Render.Box_Outline(vectors, colors, roundings);`

| Name      | Type    | Description                       |
| --------- | ------- | --------------------------------- |
| vectors   | `table` | Two vectors for the position.     |
| colors    | `table` | Four colors for gradients.        |
| roundings | `table` | Four boolean values for rounding. |

**Allows you to make an outline with different colors and roundings.**\
\ <mark style="color:red;">**! WARNING !**</mark>\ <mark style="color:red;">**This method may be disabled soon due to obsolescence.**</mark>\ <mark style="color:red;">**New method:**</mark> [*<mark style="color:blue;">**#modern-box**</mark>*](https://monytools.gitbook.io/type/render#modern-box)\
\ <mark style="color:green;">**Example usage:**</mark>

```lua
-- Needs events.render.
MTools.Render.Box_Outline(
    { 
        vector(500, 500), vector(650, 520)
    },
    {
        color(250, 250, 250, 250), color(250, 250, 250, 250), 
        color(250, 250, 250, 250), color(250, 250, 250, 250), 
    },
    {
        false, false,
        true, true,
    }
);
-- Draws a box outline with two non-rounded corners at the top and two rounded corners at the bottom, in white.
```

### Box\_Outline\_Glow

`MTools.Render.Box_Outline_Glow(vectors, clr, thickness, rounding);`

| Name      | Type     | Description                   |
| --------- | -------- | ----------------------------- |
| vectors   | `table`  | Two vectors for the position. |
| clr       | `color`  | Color for glow.               |
| thickness | `number` | Amount of glow.               |
| rounding  | `number` | The rounding of the glow.     |

**Allows you to make a nice glow + rounded.**\
\ <mark style="color:green;">**Example usage:**</mark>

```lua
-- Needs events.render.
MTools.Render.Box_Outline_Glow(
    { 
        vector(500, 500), vector(650, 520)
    },
    color(250, 250, 250, 250),
    65,
    7.5
);
-- Draws a nice glow with 7.5 pixels of rounding.
```

### Histogram

`MTools.Render.Histogram(vectors, clr, steps, round);`

| Name     | Type            | Description                                                   |
| -------- | --------------- | ------------------------------------------------------------- |
| vectors  | `table`         | Two vectors, first position second size.                      |
| clr      | `table / color` | Color for the pattern. Specifying in the array will be color. |
| steps    | `table`         | Unlimited number of dots as numbers.                          |
| rounding | `number`        | Rounding out the posts.                                       |

**Allows you to create a histogram.**\
\ <mark style="color:green;">**Example usage:**</mark>

```lua
-- Needs events.render.
MTools.Render.Histogram(
    { 
        vector(500, 500), 
        vector(80, 80) 
    }, 
    color(255, 255, 255, 255),
    { 1, 6, 7, 3, 1, 9, 2, 7 }
);
-- Create a Histogram with one color from points 1 6 7 3 1 9 2 7.
MTools.Render.Histogram(
    { 
        vector(590, 500), 
        vector(80, 80) 
    }, 
    {
        color(0, 255, 255, 255),
        color(255, 0, 255, 255),
        color(255, 255, 0, 255),
    },
    { 1, 6, 7, 3, 1, 9, 2, 7 }
);
-- Creates a Histogram with three repeating colors from points 1 6 7 3 1 9 2 7.
```

### Graphic

`MTools.Render.Graphic(vectors, clr, steps);`

| Name    | Type            | Description                                                   |
| ------- | --------------- | ------------------------------------------------------------- |
| vectors | `table`         | Two vectors, first position second size.                      |
| clr     | `table / color` | Color for the pattern. Specifying in the array will be color. |
| steps   | `table`         | Unlimited number of dots as numbers.                          |

**Allows you to create a Graphic.**\
\ <mark style="color:green;">**Example usage:**</mark>

```lua
-- Needs events.render.
MTools.Render.Graphic(
    { 
        vector(500, 500), 
        vector(80, 80) 
    }, 
    color(255, 255, 255, 255),
    { 1, 6, 7, 3, 1, 9, 2, 7 }
);
-- Create a Graphic with one color from points 1 6 7 3 1 9 2 7.
MTools.Render.Graphic(
    { 
        vector(590, 500), 
        vector(80, 80) 
    }, 
    {
        color(0, 255, 255, 255),
        color(255, 0, 255, 255),
        color(255, 255, 0, 255),
    },
    { 1, 6, 7, 3, 1, 9, 2, 7 }
);
-- Creates a Graphic with three repeating colors from points 1 6 7 3 1 9 2 7.
```

### Modern / Box

`MTools.Modern.Box(vectors, rounding, color);`

| Name     | Type    | Description                       |
| -------- | ------- | --------------------------------- |
| vectors  | `table` | Two vectors for the position.     |
| rounding | `table` | Four numeric values for rounding. |
| color    | `color` | Box color.                        |

**Allows you to create a box with different rounded edges.**\
\ <mark style="color:green;">**Example usage:**</mark>

```lua
-- Needs events.render.
MTools.Render.Modern.Box(
    { 
        vector(500, 500), vector(650, 520)
    },
    {
        0, 3, 
        6, 9, 
    },
    color(15, 15, 15, 127)
);
-- Draws a box with rounded 0, 3, 6, 9 black with half transparency.
```

### **Modern / Box\_outline**

`MTools.Modern.Box_Outline(vectors, rounding, color, thickness);`

| Name      | Type     | Description                       |
| --------- | -------- | --------------------------------- |
| vectors   | `table`  | Two vectors for the position.     |
| rounding  | `table`  | Four numeric values for rounding. |
| color     | `color`  | Outline color.                    |
| thickness | `number` | Outline thickness.                |

**Allows you to create an outline with different rounded edges.**\
\ <mark style="color:green;">**Example usage:**</mark>

```lua
-- Needs events.render.
MTools.Render.Modern.Box_Outline(
    { 
        vector(500, 500), vector(650, 520)
    },
    {
        0, 3, 
        6, 9, 
    },
    color(255, 255, 2555, 255),
    1.25
);
-- Draws an outline with rounded 0, 3, 6, 9 white.
```
