• Studio

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • PinchGestureEnded

    When the fingers finally let go after a pinch gesture, PinchGestureEnded is what is sent through the PinchOrDragEnded event from Service.Input class. This data container class is dedicated to tracking the details of a pinch gesture at the moment it concludes.

    PinchGestureEnded keeps the historical details such as the position where the pinch began, the final position, the total distance the pinch covered, and how fast the pinch was. It also computes the scale factor, depending on the distance covered by the pinch. These properties can be very useful in determining the final adjustments based on the pinch gesture in your touch-based interactions.

    While important for doing post-input reactions and FX, this is less commonly used for input interactions as its counterparts Class.PinchGestureBegan and Class.PinchGestureChanged .

    Properties

    The 'DeltaPosition' property captures the change in position of the pinch gesture from the previous frame to the end frame. This gives the final motion vector of the pinch gesture.

    The 'StartPosition' property stores the initial position where the pinch gesture started, providing a reference point to calculate the total movement when the pinch ends.

    The 'Position' property holds the final position of the pinch gesture right before it concluded. It's the last recorded position of the pinch.

    The 'Velocity' property calculates the speed of the pinch gesture based on its distance and time. This is beneficial when the effect of the pinch gesture is influenced by its speed.

    distance

    number

    The 'Distance' property represents the total gap between the two touch points in the pinch, from the start till the end. This measures the full spread of a pinch gesture.

    scale

    number

    The 'Scale' property computes the final scaling factor considering the overall distance the pinch gesture covered. It comes in handy when applying the final touches in zoom or scale interaction based on pinch gesture.

    Updated 4 months ago

    PocketWorlds Icon

    © 2024 Pocket Worlds. All rights reserved.