# sm.gui.createGuiFromLayout

Create a GUI from a layout file.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.gui.createGuiFromLayout( layout, destroyOnClose?, settings? )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.gui.md#createguifromlayout)

**Availability:** Client only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `layout` | string | Path to the layout file |
| `destroyOnClose` *(optional)* | boolean | If true the gui is destroyed when closed, otherwise the gui can be reused. (Defaults to false) |
| `settings` *(optional)* | table | Table with bool settings for: isHud, isInteractive, needsCursor |

**Returns:**

| Type | Description |
| --- | --- |
| [GuiInterface](../Game-Script-Environment/Userdata/GuiInterface.md) | The gui interface to the created gui. |
