Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/pinchable-scrollrect.git

README Markdown

Copy this to your project's README.md

Style
Preview
pkglnk installs badge
## Installation

Add **Pinchable ScrollRect** to your Unity project via Package Manager:

1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/pinchable-scrollrect.git
```

[![pkglnk](https://www.pkglnk.dev/badge/pinchable-scrollrect.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/pinchable-scrollrect)

Dependencies (1)

README

Pinchable ScrollRect for Unity

Pinchable ScrollRect allows users to zoom in and out on the ScrollRect with both touches pinching input or mouse scroll input.

openupm

Features

  • Customizable pinching behaviour with inherited Unity ScrollRect behaviour.
  • Overridden OnScroll behaviour for mouse scroll to perform zooming behaviour.
  • Customized pinching gesture to perform the same zooming behaviour as mouse scroll input for touches.
  • Transformed standard Unity Event IPointerUp & IPointerDown interface into IPinch interface for further customization of touch behaviour

Getting Started

  • Use it same as the way you use the Unity ScrollRect component.
  • Add a UI/ScrollView from the GameObject Menu
  • Select the ScrollRect added, click on the context dropdown menu
  • Select "Replace as Pinchable"

Important Remarks

  • PinchInputDetector component must have a higher execution order than PinchableScrollRect component or any IPinchHandler component in order to consume the original OnDrag pointer event beforehand.
  • Without PinchInputDetector, the ScrollRect can still perform zooming with mouse scroll input but not touch input.
  • The absolute minimum scale of the Content of the ScrollRect is 1. A customizable lower bound and upper bound of the scale can be set on inspector.
  • Any third touches detected after pinching will be ignore, even after both pinching touches are lifted.
  • Editor script is needed in order to serialize the extra fields added to the PinchableScrollRect component.

License

This plugin is licensed under the MIT License - see the LICENSE file for details.

Comments

No comments yet. Be the first!