Class PointerCaptureEventBase<T>
Base class for pointer capture events and mouse capture events.
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
public abstract class PointerCaptureEventBase<T> : EventBase<T>, IPointerCaptureEvent where T : PointerCaptureEventBase<T>, new()
Type Parameters
Name | Description |
---|---|
T |
Constructors
PointerCaptureEventBase()
Declaration
protected PointerCaptureEventBase()
Properties
pointerId
Identifies the pointer that sends the event.
Declaration
public int pointerId { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
If the mouse sends the event, this property is set to 0. If a touchscreen device sends the event, this property is set to the finger ID, which ranges from 1 to the number of touches the device supports.
relatedTarget
For PointerCaptureEvent and MouseCaptureEvent, returns the VisualElement that loses the pointer capture, if any. For PointerCaptureOutEvent and MouseCaptureOutEvent, returns the VisualElement that captures the pointer.
Declaration
public IEventHandler relatedTarget { get; }
Property Value
Type | Description |
---|---|
IEventHandler |
Methods
GetPooled(IEventHandler, IEventHandler, Int32)
Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use Dispose()
to release them.
Declaration
public static T GetPooled(IEventHandler target, IEventHandler relatedTarget, int pointerId)
Parameters
Type | Name | Description |
---|---|---|
IEventHandler | target | For PointerCapture and MouseCapture events, the element that captures the pointer. For PointerCaptureOut and MouseCaptureOut events, the element that releases the pointer. |
IEventHandler | relatedTarget | For PointerCaptureEvent and MouseCaptureEvent, returns the element that loses the pointer capture, if any. For PointerCaptureOutEvent and MouseCaptureOutEvent, returns the element that captures the pointer. |
Int32 | pointerId | The pointer that is captured or released. |
Returns
Type | Description |
---|---|
T | An initialized event. |
Init()
Resets the event members to their initial values.
Declaration
protected override void Init()