Skip to main content

Screen Pan

screen pan

Use Screen Pan to execute the next node when someone moves their finger on the device screen over 30 pixels.

Below is an example of the position coordinates for a screen pan:

position coordinates for a screen pan

Output

NameData TypeDescription
NextExecExecute the next node when the finger is moving on the device screen.
OffsetVec2The distance between the start position and the moving position of the finger on the device screen.
PositionVec2The 2D position of the finger on the device screen.

Example

screen pan example

↓ screen_hold.zip

This example shows how to use Screen Pan to control the position of the sphere in real-time.

screen hold node

Move this example a little bit further by using the offset property of Screen Pan to get the distance moved from the starting point. Apply this value to scale the sphere you are controlling now.

screen pan example extended example
screen pan node extended example