Swipe Gesture
Detect swipe gestures based on their distance and duration.
Authors and contributors to this community extension: E1e5en, VictrisGames.
Use the "Enable swipe detection" action at the beginning of your scene.
Note: This extension does NOT support multitouch.
Expressions:
StartX,StartY: Position where the swipe startedEndX,EndY: Position where the swipe endedDistance: Length of the swipe, in pixelsDistanceX,DistanceY: Distance the swipe moved in each axisAngle: Direction the swipe moved towards. Range (-180, 180)Layer: Layer used to detect swipe gestures
Conditions:
Is swipe detection enabledIs swipe in progress?- A swipe starts when the mouse click or touch beginsHas swipe just ended?- When the mouse or touch is released, this condition is true for one frameSwipe moved in a direction (4-way movement)- the direction value for 4 sides (UP, DOWN, LEFT, RIGHT). In this case, the “circle” is divided into 4 segments of 90 degreesSwipe moved in a direction (8-way movement)- the direction value for 8 sides (UP, DOWN, LEFT, RIGHT, UP-LEFT, UP-RIGHT, DOWN-LEFT, DOWN-RIGHT). In this case, the “circle” is divided into 8 segments of 45 degrees.
Tip
Learn how to install new extensions by following a step-by-step guide.
This page is an auto-generated reference page about the Swipe Gesture extension, made by the community of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop community-made extensions here.