Table of Contents

Method GetSwipeDirectionFromAngle

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetSwipeDirectionFromAngle(float)

Determines the swipe direction based on the specified angle in degrees.

public static SwipeDirection GetSwipeDirectionFromAngle(float angle)

Parameters

angle float

The angle, in degrees, representing the direction of the swipe. Valid values are typically in the range 0 to 360.

Returns

SwipeDirection

A value of type SwipeDirection indicating the detected swipe direction: Up, Down, Left, or Right.

Remarks

The method interprets the angle as follows: 45–135 degrees as Up, 0–45 and 315–360 degrees as Right, 225–315 degrees as Down, and all other angles as Left. This is useful for gesture recognition in touch or pointer input scenarios.