Description
The CursorDragDelta
property provides the delta of cursor movement between the last mouse press and the current position, measured in screen space. This property is useful for tracking how much the cursor has moved while the left mouse button is held down. If the left mouse button is not currently pressed, this property will return the value of CursorMoveDelta
, which represents the cursor movement between the current and previous frames.
Usage
Use CursorDragDelta
to determine the amount of movement the cursor has made since the last mouse press. This can be particularly useful in scenarios where you need to implement drag-and-drop functionality or track mouse movement while a button is held down.
Example usage:
Vector2 dragDelta = Gizmo.CursorDragDelta;
if (Gizmo.IsLeftMouseDown)
{
// Perform actions based on the drag delta
MoveObject(dragDelta);
}
Example
Vector2 dragDelta = Gizmo.CursorDragDelta;
if (Gizmo.IsLeftMouseDown)
{
// Perform actions based on the drag delta
MoveObject(dragDelta);
}