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).
Static methods
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.