Giter Site home page Giter Site logo

anu-prakash-dev / touchscript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from touchscript/touchscript

0.0 1.0 0.0 15.71 MB

Complete multi-touch solution for Unity: iOS, Android, Windows, TUIO.

License: Other

Shell 0.76% C++ 0.58% C 0.63% C# 97.67% ShaderLab 0.37%

touchscript's Introduction

TouchScript — multi-touch library for Unity

When working on a project for mobile devices or PCs with touch input you will soon require basic gestures like tap, pan, pinch and zoom — they are not hard to implement manually using Unity API or using a package from Asset Store. The hard part is to make these gestures work together, e.g. to have a button with a tap gesture placed on a zoomable window. This is where you will need TouchScript — it makes handling complex gesture interactions on any touch surface an effortless job.

Why TouchScript?

  • TouchScript abstracts touch and gesture logic from input methods and platforms. Your touch-related code will be the same everywhere.
  • TouchScript supports many touch input methods starting from smartphones to giant touch surfaces: mouse, Windows 7/8 touch, mobile (iOS, Android, Windows Store/Windows Phone), TUIO.
  • TouchScript includes common gesture implementations: press, release, tap, long press, flick, pinch/scale/rotate.
  • TouchScript allows you to write your own gestures and custom pointer input logic.
  • TouchScript manages gestures in transform hierarchy and makes sure that the most relevant gesture will receive touch input.
  • TouchScript comes with many examples and is extensively documented.
  • TouchScript makes it easy to test multi-touch gestures without an actual multi-touch device using built-in second touch simulator (activated with Alt + click), TUIOPad on iOS or TUIODroid on Android. Read more.
  • It's free and open-source. Licensed under MIT license.

Developed by Valentin Simonov.

Getting started

Downloading the package

To use TouchScript in your project you either need to

Your first TouchScript project

To test how TouchScript works, create an empty scene and drag two prefabs from TouchScript/Prefabs folder to the scene: TouchManager and Cursors. Press Play and click or touch (if your PC supports touch input) the Game View — you will see colored circles, pointer cursors.

Note: to simulate a second pointer you can hold Alt and click anywhere within the Game View.

You can make any GameObject react to touch input — just attach one of the scripts called Gestures to it. TouchScript ships with a few built-in Gestures which you can find in Component/TouchScript/Gestures menu. It is also possible to write your own gestures.

To test how built-in Gestures work, create an empty cube in the scene and attach a TransformGesture to it either from Component menu or Add Component button. Make the cube large enough to be able to touch it with two fingers. Attach another component called Transformer to the cube — this component listens to events from TransformGesture and applies translation, rotation and scaling to the GameObject.

Press Play. Note how you can drag the object with one touch and scale or rotate it with two touches. Don't forget that you can use Alt + click to simulate a second pointer (read more more about testing multi-touch gestures).

Examples

TouchScript comes with many examples in TouchScript/Examples folder. Open Examples.unity scene and read description for every example to find out what it is about.

All examples are explaned here.

What to read next

Need help?

If you have a problem using TouchScript or running examples please check the FAQ before submitting issues.

  • FAQ
    Some of the questions have been already asked multiple times. Check if yours is in the list.
  • Documentation
    Complete up-to-date generated docs with all public API annotated.
  • Official Forum
    Want to ask a question about TouchScript? Use the official Forum.
  • Issues
    Found a bug? Got a feature request? Feel free to post it in Issues.

touchscript's People

Contributors

valyard avatar mholub avatar pharaohmaster avatar tachylatus avatar yerek avatar benoitjadinon avatar bering avatar denizpiri avatar gregharding avatar manefunction avatar darkon76 avatar paynechu avatar shreks7 avatar capnslipp avatar deadninja avatar o1o1o1o1o2 avatar

Watchers

Anu Prakash avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.