# ModalWindow

> Show a Modal Window.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.IMGUIModule

## ModalWindow(int, Rect, WindowFunction, string)

Show a Modal Window.

```csharp
public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, string text)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A unique id number.**** (\[Rect]\(/engine/6000.7/script-reference/unityengine/rect)): Position and size of the window.**** (\[WindowFunction]\(/engine/6000.7/script-reference/unityengine/gui/windowfunction)): A function which contains the immediate mode GUI code to draw the contents of your window.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Text to appear in the title-bar area of the window, if any.

### Returns

| Type                                                        | Description |
| ----------------------------------------------------------- | ----------- |
| [Rect](/engine/6000.7/script-reference/unityengine/rect.md) |             |

### Remarks

Similar to [GUI.Window](/engine/6000.7/script-reference/unityengine/gui/window.md), however the window will always be on top of all other GUI, and while displayed, is guaranteed to be sole recipient of all GUI input and events. While a ModalWindow is being displayed, other controls will not be processing input. Note that only one ModalWindow can be displayed at a time.

## ModalWindow(int, Rect, WindowFunction, Texture)

Show a Modal Window.

```csharp
public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, Texture image)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A unique id number.**** (\[Rect]\(/engine/6000.7/script-reference/unityengine/rect)): Position and size of the window.**** (\[WindowFunction]\(/engine/6000.7/script-reference/unityengine/gui/windowfunction)): A function which contains the immediate mode GUI code to draw the contents of your window.**** (\[Texture]\(/engine/6000.7/script-reference/unityengine/texture)): An image to appear in the title bar of the window, if any.

### Returns

| Type                                                        | Description |
| ----------------------------------------------------------- | ----------- |
| [Rect](/engine/6000.7/script-reference/unityengine/rect.md) |             |

### Remarks

Similar to [GUI.Window](/engine/6000.7/script-reference/unityengine/gui/window.md), however the window will always be on top of all other GUI, and while displayed, is guaranteed to be sole recipient of all GUI input and events. While a ModalWindow is being displayed, other controls will not be processing input. Note that only one ModalWindow can be displayed at a time.

## ModalWindow(int, Rect, WindowFunction, GUIContent)

Show a Modal Window.

```csharp
public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, GUIContent content)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A unique id number.**** (\[Rect]\(/engine/6000.7/script-reference/unityengine/rect)): Position and size of the window.**** (\[WindowFunction]\(/engine/6000.7/script-reference/unityengine/gui/windowfunction)): A function which contains the immediate mode GUI code to draw the contents of your window.**** (\[GUIContent]\(/engine/6000.7/script-reference/unityengine/guicontent)): GUIContent to appear in the title bar of the window, if any.

### Returns

| Type                                                        | Description |
| ----------------------------------------------------------- | ----------- |
| [Rect](/engine/6000.7/script-reference/unityengine/rect.md) |             |

### Remarks

Similar to [GUI.Window](/engine/6000.7/script-reference/unityengine/gui/window.md), however the window will always be on top of all other GUI, and while displayed, is guaranteed to be sole recipient of all GUI input and events. While a ModalWindow is being displayed, other controls will not be processing input. Note that only one ModalWindow can be displayed at a time.

## ModalWindow(int, Rect, WindowFunction, string, GUIStyle)

Show a Modal Window.

```csharp
public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, string text, GUIStyle style)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A unique id number.**** (\[Rect]\(/engine/6000.7/script-reference/unityengine/rect)): Position and size of the window.**** (\[WindowFunction]\(/engine/6000.7/script-reference/unityengine/gui/windowfunction)): A function which contains the immediate mode GUI code to draw the contents of your window.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Text to appear in the title-bar area of the window, if any.**** (\[GUIStyle]\(/engine/6000.7/script-reference/unityengine/guistyle)): Style to apply to the window.

### Returns

| Type                                                        | Description |
| ----------------------------------------------------------- | ----------- |
| [Rect](/engine/6000.7/script-reference/unityengine/rect.md) |             |

### Remarks

Similar to [GUI.Window](/engine/6000.7/script-reference/unityengine/gui/window.md), however the window will always be on top of all other GUI, and while displayed, is guaranteed to be sole recipient of all GUI input and events. While a ModalWindow is being displayed, other controls will not be processing input. Note that only one ModalWindow can be displayed at a time.

## ModalWindow(int, Rect, WindowFunction, Texture, GUIStyle)

Show a Modal Window.

```csharp
public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, Texture image, GUIStyle style)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A unique id number.**** (\[Rect]\(/engine/6000.7/script-reference/unityengine/rect)): Position and size of the window.**** (\[WindowFunction]\(/engine/6000.7/script-reference/unityengine/gui/windowfunction)): A function which contains the immediate mode GUI code to draw the contents of your window.**** (\[Texture]\(/engine/6000.7/script-reference/unityengine/texture)): An image to appear in the title bar of the window, if any.**** (\[GUIStyle]\(/engine/6000.7/script-reference/unityengine/guistyle)): Style to apply to the window.

### Returns

| Type                                                        | Description |
| ----------------------------------------------------------- | ----------- |
| [Rect](/engine/6000.7/script-reference/unityengine/rect.md) |             |

### Remarks

Similar to [GUI.Window](/engine/6000.7/script-reference/unityengine/gui/window.md), however the window will always be on top of all other GUI, and while displayed, is guaranteed to be sole recipient of all GUI input and events. While a ModalWindow is being displayed, other controls will not be processing input. Note that only one ModalWindow can be displayed at a time.

## ModalWindow(int, Rect, WindowFunction, GUIContent, GUIStyle)

Show a Modal Window.

```csharp
public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, GUIContent content, GUIStyle style)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A unique id number.**** (\[Rect]\(/engine/6000.7/script-reference/unityengine/rect)): Position and size of the window.**** (\[WindowFunction]\(/engine/6000.7/script-reference/unityengine/gui/windowfunction)): A function which contains the immediate mode GUI code to draw the contents of your window.**** (\[GUIContent]\(/engine/6000.7/script-reference/unityengine/guicontent)): GUIContent to appear in the title bar of the window, if any.**** (\[GUIStyle]\(/engine/6000.7/script-reference/unityengine/guistyle)): Style to apply to the window.

### Returns

| Type                                                        | Description |
| ----------------------------------------------------------- | ----------- |
| [Rect](/engine/6000.7/script-reference/unityengine/rect.md) |             |

### Remarks

Similar to [GUI.Window](/engine/6000.7/script-reference/unityengine/gui/window.md), however the window will always be on top of all other GUI, and while displayed, is guaranteed to be sole recipient of all GUI input and events. While a ModalWindow is being displayed, other controls will not be processing input. Note that only one ModalWindow can be displayed at a time.
