# ISupportsOverlays

> Implement this interface to enable overlays in the EditorWindow.

## Definition

* **Type:** Interface
* **Namespace:** [UnityEditor.Overlays](/engine/6000.7/script-reference/unityeditor/overlays.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public interface ISupportsOverlays
```

## Remarks

When [ISupportsOverlays](/engine/6000.7/script-reference/unityeditor/overlays/isupportsoverlays.md) is implemented, an Overlay Canvas is automatically added to the [VisualElement](/engine/6000.7/script-reference/unityengine/uielements/visualelement.md) tree for your [EditorWindow](/engine/6000.7/script-reference/unityeditor/editorwindow.md). [OverlayAttribute](/engine/6000.7/script-reference/unityeditor/overlays/overlayattribute.md) will now be able to specify this window type as a valid target for registering an [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md).

## Examples

```csharp
using System;
using UnityEditor;
using UnityEditor.Overlays;
using UnityEngine;
using UnityEngine.UIElements;

class EditorWindowOverlayExample : EditorWindow, ISupportsOverlays
{
    [MenuItem("Window/Overlay Supported Window Example")]
    static void Init() => GetWindow<EditorWindowOverlayExample>();

    void OnGUI()
    {
        GUILayout.Label("Here is some text");
        GUILayout.FlexibleSpace();
        GUILayout.Label("Plus some more text, but on the bottom of the screen.");
    }
}

[Overlay(typeof(EditorWindowOverlayExample), "Is Mouse Hovering Me?", true)]
class IsMouseHoveringMe : Overlay
{
    Label m_MouseLabel;

    public override VisualElement CreatePanelContent()
    {
        m_MouseLabel = new Label();
        m_MouseLabel.style.minHeight = 40;
        m_MouseLabel.RegisterCallback<MouseEnterEvent>(evt => m_MouseLabel.text = "Mouse is hovering this Overlay content!");
        m_MouseLabel.RegisterCallback<MouseLeaveEvent>(evt => m_MouseLabel.text = "Mouse is not hovering this Overlay content.");
        return m_MouseLabel;
    }
}
```
