Pinching gesture
Move the camera or objects with pinching gestures.
Authors and contributors to this experimental 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.
See parameters
- Parameter 1 (❓ Yes or No): Enable camera pinch
Technical note: parameters 0, 2 are internal parameters handled by GDevelop.
Camera pinch constraints
Change the camera pinch constraint.
See parameters
- Parameter 1 (🔤 String): Constraint (one of: "No constraint", "Zoom only", "Rotation only", "Zoom and rotation only")
Technical note: parameters 0, 2 are internal parameters handled by GDevelop.
Camera pinch layer
Choose the layer to move with pinch gestures.
See parameters
- Parameter 1: 🔤 Layer name (String)
Technical note: parameters 0, 2 are internal parameters handled by GDevelop.
Conditions
Camera pinch is enabled
Check if camera pinch is enabled.
See parameters
Technical note: parameters 0, 1 are internal parameters handled by GDevelop.
Touch is pinching
Check if a touch is pinching, if 2 touches are pressed.
See parameters
Technical note: parameters 0, 1 are internal parameters handled by GDevelop.
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 name) |
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 name (String) | Layer | |
PinchGesture::InversedY(number, number, layer name) |
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 name (String) | 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 name) |
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 name (String) | Layer | |
PinchGesture::TransformedY(number, number, layer name) |
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 name (String) | Layer | |
PinchGesture::TranslationX(layer name) |
Return the horizontal translation of the pinch gesture from its beginning. | |
🔤 Layer name (String) | Layer | |
PinchGesture::TranslationY(layer name) |
Return the vertical translation of the pinch gesture from its beginning. | |
🔤 Layer name (String) | Layer |
Pinchable object
Move objects by holding 2 touches on them.
Behavior actions
Abort pinching
Abort the pinching of this object.
See parameters
- Parameter 0: 👾 Object
- Parameter 1: 🧩 Behavior
Technical note: parameter 2 are internal parameters handled by GDevelop.
Behavior conditions
Is being pinched
Check if the object is being pinched.
See parameters
- Parameter 0: 👾 Object
- Parameter 1: 🧩 Behavior
Technical note: parameter 2 are internal parameters handled by GDevelop.
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.