# GetScreenRect

> Returns bounding rectangle of GUIElement in screen coordinates.

## Definition

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

## GetScreenRect(Camera)

Returns bounding rectangle of [GUIElement](/engine/6000.5/script-reference/unityengine/guielement.md) in screen coordinates.

> **Warning:**
>
> **Removed.** GUIElement has been removed. Consider using [https://docs.unity3d.com/ScriptReference/UIElements.Image.html](https://docs.unity3d.com/ScriptReference/UIElements.Image.html), [https://docs.unity3d.com/ScriptReference/UIElements.TextElement.html](https://docs.unity3d.com/ScriptReference/UIElements.TextElement.html) or TextMeshPro instead.

```csharp
public Rect GetScreenRect(Camera camera)
```

### Parameters

**** (\[Camera]\(/engine/6000.5/script-reference/unityengine/camera)):&#x20;

### Returns

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

### Remarks

If no `camera` is given a camera filling the entire game window will be assumed.

## GetScreenRect()

Returns bounding rectangle of [GUIElement](/engine/6000.5/script-reference/unityengine/guielement.md) in screen coordinates.

> **Warning:**
>
> **Removed.** GUIElement has been removed. Consider using [https://docs.unity3d.com/ScriptReference/UIElements.Image.html](https://docs.unity3d.com/ScriptReference/UIElements.Image.html), [https://docs.unity3d.com/ScriptReference/UIElements.TextElement.html](https://docs.unity3d.com/ScriptReference/UIElements.TextElement.html) or TextMeshPro instead.

```csharp
public Rect GetScreenRect()
```

### Returns

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

### Remarks

If no `camera` is given a camera filling the entire game window will be assumed.
