Class PointerCaptureHelper
A static class to capture and release pointers.
Namespace: UnityEngine.UIElements
Syntax
public static class PointerCaptureHelper : object
Methods
CapturePointer(IEventHandler, Int32)
Captures the pointer.
Declaration
public static void CapturePointer(this IEventHandler handler, int pointerId)
Parameters
Type | Name | Description |
---|---|---|
IEventHandler | handler | The VisualElement that captures the pointer. |
Int32 | pointerId | The pointer to capture. |
Remarks
When a VisualElement captures a pointer, all pointer events are sent to the element, regardless of which element is under the pointer.
GetCapturingElement(IPanel, Int32)
Returns the element that is capturing the pointer.
Declaration
public static IEventHandler GetCapturingElement(this IPanel panel, int pointerId)
Parameters
Type | Name | Description |
---|---|---|
IPanel | panel | The panel that holds the element. |
Int32 | pointerId | The captured pointer. |
Returns
Type | Description |
---|---|
IEventHandler | The element that is capturing the pointer. |
HasPointerCapture(IEventHandler, Int32)
Tests whether the element has captured the pointer.
Declaration
public static bool HasPointerCapture(this IEventHandler handler, int pointerId)
Parameters
Type | Name | Description |
---|---|---|
IEventHandler | handler | The VisualElement being tested. |
Int32 | pointerId | The captured pointer. |
Returns
Type | Description |
---|---|
Boolean | True if element captured the pointer. |
ReleasePointer(IEventHandler, Int32)
Tests whether an element captured a pointer and, if so, tells the element to release the pointer.
Declaration
public static void ReleasePointer(this IEventHandler handler, int pointerId)
Parameters
Type | Name | Description |
---|---|---|
IEventHandler | handler | The element which potentially captured the pointer. |
Int32 | pointerId | The captured pointer. |
ReleasePointer(IPanel, Int32)
Releases the pointer.
Declaration
public static void ReleasePointer(this IPanel panel, int pointerId)
Parameters
Type | Name | Description |
---|---|---|
IPanel | panel | The panel that holds the element that captured the pointer. |
Int32 | pointerId | The captured pointer. |