Pinching gesture
Move the camera or objects with pinching gestures.
Authors and contributors to this community extension: D8H.
This extension allows to:
- Move, rotate and/or zoom the camera according to pinch gestures
- Move, rotate and optionally scale objects according to pinch gestures
- Handle more specific needs with various expressions
Limitations:
- Only one pinching gesture is detected at a time
Tip
Learn how to install new extensions by following a step-by-step guide.
Actions
Enable or disable camera pinch
Enable or disable camera pinch.
Camera pinch constraints
Change the camera pinch constraint.
Camera pinch layer
Choose the layer to move with pinch gestures.
Conditions
Camera pinch is enabled
Check if camera pinch is enabled.
Touch is pinching
Check if a touch is pinching, if 2 touches are pressed.
Expressions
Expression | Description | |
---|---|---|
PinchGesture::BeginningCenterX(string) |
Return the X position of the pinch center at the beginning of the gesture. | |
string | Layer | |
PinchGesture::BeginningCenterY(string) |
Return the Y position of the pinch center at the beginning of the gesture. | |
string | Layer | |
PinchGesture::CurrentCenterX(string) |
Return the X position of the pinch center. | |
string | Layer | |
PinchGesture::CurrentCenterY(string) |
Return the Y position of the pinch center. | |
string | Layer | |
PinchGesture::InversedX(number, number, layer) |
Return the original X position of a point before the pinch gesture. | |
number | Position X after the pinch | |
number | Position Y after the pinch | |
layer | Layer | |
PinchGesture::InversedY(number, number, layer) |
Return the new position on the Y axis of a point after the pinch gesture. | |
number | Position X after the pinch | |
number | Position Y after the pinch | |
layer | Layer | |
PinchGesture::Rotation() |
Return the rotation of the pinch gesture from its beginning (in degrees). | |
PinchGesture::Scaling() |
Return the scaling of the pinch gesture from its beginning. | |
PinchGesture::TransformedX(number, number, layer) |
Return the new X position of a point after the pinch gesture. | |
number | Position X before the pinch | |
number | Position Y before the pinch | |
layer | Layer | |
PinchGesture::TransformedY(number, number, layer) |
Return the new Y position of a point after the pinch gesture. | |
number | Position X before the pinch | |
number | Position Y before the pinch | |
layer | Layer | |
PinchGesture::TranslationX(layer) |
Return the horizontal translation of the pinch gesture from its beginning. | |
layer | Layer | |
PinchGesture::TranslationY(layer) |
Return the vertical translation of the pinch gesture from its beginning. | |
layer | Layer |
Pinchable object
Move objects by holding 2 touches on them.
Behavior actions
Abort pinching
Abort the pinching of this object.
Behavior conditions
Is being pinched
Check if the object is being pinched.
No expressions for this behavior.
This page is an auto-generated reference page about the Pinching 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.