# Handles.CapFunction

> The function to use for drawing the handle e.g. Handles.RectangleCap.

## Definition

* **Type:** Delegate
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public delegate void Handles.CapFunction(int controlID, Vector3 position, Quaternion rotation, float size, EventType eventType)
```

## Remarks

Custom CapFunction has two responsibilities:

1. For \[[EventType.Layout](/engine/6000.0/script-reference/unityengine/eventtype/layout.md) event, call [HandleUtility.AddControl](/engine/6000.0/script-reference/unityeditor/handleutility/addcontrol.md) to inform Unity about the distance of the handle from mouse position.

2. For \[[EventType.Repaint](/engine/6000.0/script-reference/unityengine/eventtype/repaint.md) event, render the actual handle.
