> ## Documentation Index
> Fetch the complete documentation index at: https://luas.getconstant.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Menu

## Draw

Returns an instance of the specified class 'Type' with the given properties. Internally, the render is appended to the Menu.Renders table and the global ZIndex is increased by 1. \\

FontFace is handled differently, it must be a table containing at index 1, the Font and at index 2, the textsize. Menu.Fonts contains the default Fonts used by the Menu. TextSize can be overwritten by passing in the TextSize property into the properties table.

```lua lines theme={"dark"}
Menu.Draw(string: Type, table?: Properties)
```

<ParamField path="Type" type="string" required>
  The instance class to create.
</ParamField>

<ParamField path="Properties" type="table">
  The table containing the properties to apply to the render.
</ParamField>

## Remove

Destroys a render and removes itself and it's desscendants from the Menu.Renders table. Use this instead of manually destroying renders created by Menu.Draw.

```lua lines theme={"dark"}
Menu.Remove(instance: Render)

-- Removes a render and it's descendants from the Menu.Renders table, then destroys the instance.
-- This is the proper way to destroy renders created by Menu.Draw.
```

<ParamField path="Render" type="instance" required>
  The Render to destroy.
</ParamField>

## ShadeColor

Returns a Color3, the result of the base Color's R/G/B values multiplied by the provided R/G/B values.

```lua lines theme={"dark"}
Menu.ShadeColor(Color3: Color, number: Red, number: Green, number: Blue)
```

<ParamField path="Color" type="Color3" required>
  The base color.
</ParamField>

<ParamField path="Red" type="number" required />

<ParamField path="Green" type="number" required />

<ParamField path="Blue" type="number" required />

## GetDescendants

Returns a table of the Render's descendants inclusive of itself at index 1.

```lua lines theme={"dark"}
Menu.GetDescendants(instance: Render)
```

<ParamField path="Render" type="instance" required>
  The base render.
</ParamField>

## ToRichText

Returns a formatted string for rich text.

```lua lines theme={"dark"}
Menu.ToRichText(string: Text, Color3: Color)
```

Usage example:

```lua theme={"dark"}
Menu.ToRichText('Hello <font color="rgb(#s)">this is red</font>', Color3.fromRGB(255, 0, 0))
```

<ParamField path="Text" type="string" required>
  The raw text.
</ParamField>

<ParamField path="Color" type="Color3" required>
  Enter a description
</ParamField>

## Tween

Tweens a render, instantly plays it with the given data and returns the tween object.

```lua lines theme={"dark"}
Menu.Tween(instance: Render, TweenInfo: TweenInfo, table: Properties)
```

Usage Example:

```lua theme={"dark"}
Menu.Tween(Frame, TweenInfo.new(1, Enum.EasingStyle.Linear), { Position = UDim2.new(1, 0, 1, 0) })
```

<ParamField path="Render" type="instance" required>
  The render to tween.
</ParamField>

<ParamField path="TweenInfo" type="TweenInfo" required />

<ParamField path="Properties" type="table" required>
  The properties to tween.
</ParamField>

## ImportImage

Returns an assetid of the image from the base64 encoded data.

```lua lines theme={"dark"}
Menu.ImportImage(string: Name, string: Data)
```

<ParamField path="Name" type="string" required>
  The name of the image.
</ParamField>

<ParamField path="Data" type="string" required>
  The base64 encoding of the Image.
</ParamField>

## ImportFont

Returns a Font object from the given base64 encoded data.

```lua lines theme={"dark"}
Menu.ImportFont(string: Name, string: Data, number?: WeightNumber, enum?: WeightEnum, enum?: StyleEnum)
```

<ParamField path="Name" type="string" required>
  The name of the Font.
</ParamField>

<ParamField path="Data" type="string" required>
  The base64 encoding of the font.
</ParamField>

<ParamField path="number" type="WeightNumber" placeholder="400" />

<ParamField path="enum" type="WeightEnum" placeholder="Enum.FontWeight.Regular" />

<ParamField path="StyleEnum" type="enum" placeholder="Enum.FontStyle.Normal" />

## GetTextBounds

Returns thte text bounds (Vector2) of the text from the given font. Refer to [Draw](/libraries/menu#draw) for info on FontFace.

```lua lines theme={"dark"}
Menu.GetTextBounds(string: Text, table: FontFace, number?: TextSize)
```

<ParamField path="Text" type="string" required />

<ParamField path="FontFace" type="table" required />

<ParamField path="TextSize" type="number" />
