Utility class for handling swipe gestures in HaxeFlixel and dispatching signals for different swipe directions.

Example usage:

if (SwipeUtil.justSwipedLeft) trace("Swiped left!");

if (SwipeUtil.swipeRight) trace("User is swiping/dragging right!");

if (SwipeUtil.justFlickedUp) trace("Flicked up!");

if (SwipeUtil.flickUp) trace("User has flicked up!");

if (SwipeUtil.justSwipedAny) trace("Swiped in any direction!");

Static variables

staticread onlyflickAny:Bool

Boolean variable that returns true if any flick direction is detected (down, left, up, or right).

staticread onlyflickDown:Bool

Checks if a downward flick direction is detected.

staticread onlyflickLeft:Bool

Checks if a leftward flick direction is detected.

staticread onlyflickRight:Bool

Checks if a rightward flick direction is detected.

staticread onlyflickUp:Bool

Checks if an upward flick direction is detected.

staticread onlyjustSwipedAny:Bool

Indicates if there is any swipe gesture detected.

staticread onlyjustSwipedDown:Bool

Indicates if there is a down swipe gesture detected.

staticread onlyjustSwipedLeft:Bool

Indicates if there is a left swipe gesture detected.

staticread onlyjustSwipedRight:Bool

Indicates if there is a right swipe gesture detected.

staticread onlyjustSwipedUp:Bool

Indicates if there is an up swipe gesture detected.

staticread onlyswipeAny:Bool

Tracks if any swipe direction is detected (down, left, up, or right).

staticread onlyswipeDown:Bool

Tracks if a downward swipe has been detected.

staticread onlyswipeLeft:Bool

Tracks if a leftward swipe has been detected.

staticread onlyswipeRight:Bool

Tracks if a rightward swipe has been detected.

staticread onlyswipeUp:Bool

Tracks if an upward swipe has been detected.

Static methods

@:value({ multiplier : 1 })staticcalculateSwipeThreshold(items:Array<Dynamic>, axes:FlxAxes, multiplier:Float = 1):Void

Updates the swipe threshold based on the provided group.

Parameters:

items

The array whose items' positions are used to calculate the swipe threshold.

axes

The axis to calculate the swipe threshold for.

multiplier

Optional value that multiplies the final swipe threshold with it.

staticinlineresetSwipeVelocity():Void

Calls the destroy function from both the global mouse and the touch manager.