• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    PinchGestureBegan

    Inherits from:

    For those times when you need to interact with touch-enabled screens in your application, this class is a data container for the start of a pinch or drag gesture, usually used for operations like zooming, panning, or scaling. It keeps track of various details of a pinch or drag gesture such as the change in position, start position, current position, direction, distance covered in the pinch, the scaling factor, and whether a pinch is currently happening. All these properties provide critical information to accurately detect and process pinch gestures for accomplishing sophisticated touch interactions. It is primarily used in the Service.Input class an the PinchOrDragBegan event's parameter.

    Properties

    The 'DeltaPosition' property holds the change in position from the last frame to the current one. It gives the motion vector of the pinch in the context of the screen space.

    The 'Direction' property provides a directional vector signifying the direction of the pinch gesture. It senses the shifting orientation as the fingers move while pinching.

    distance

    number
    ClientOnly

    The 'Distance' property computes the distance between the two touch points in a pinch. This information often plays a crucial role while performing actions like zooming where the level of zoom is determined by how much distance is covered in the pinch.

    isPinching

    boolean
    ClientOnly

    The 'IsPinching' property is a boolean that indicates whether a pinch gesture is currently in progress. This can be used to trigger or halt certain actions in response to the pinch gesture's state.

    position

    ClientOnly

    The 'Position' refers to the current position of the pinch gesture. This property updates in real-time as the pinch gesture moves.

    scale

    number
    ClientOnly

    The 'Scale' property calculates the scaling factor based on the 'Distance' property. This scaling factor is typically used to resize objects according to the pinch gesture.

    The 'StartPosition' property marks the initial position where the pinch gesture began. This serves as the reference point for further motion of the pinch.

    eventTypeId

    number
    ClientOnly
    ReadOnly

    screenPosition

    ClientOnly
    ReadOnly

    screenStartPosition

    ClientOnly
    ReadOnly

    Updated about 1 month ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.