Note how you can drag the object with one touch and scale or rotate it with two touches. Attach another component called Transformer to the cube - this component listens to events from TransformGesture and applies translation, rotation and scaling to the GameObject. Make the cube large enough to be able to touch it with two fingers. 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. It is also possible to write your own gestures. TouchScript ships with a few built-in Gestures which you can find in Component/TouchScript/Gestures menu. You can make any GameObject react to touch input - just attach one of the scripts called Gestures to it. Note: to simulate a second pointer you can hold Alt and click anywhere within the Game View. Press Play and click or touch (if your PC supports touch input) the Game View - you will see colored circles, pointer cursors. To test how TouchScript works, create an empty scene and drag two prefabs from TouchScript/Prefabs folder to the scene: TouchManager and Cursors. or clone the repository and use the source ( more info on how to do it).download the latest release from Github,.To use TouchScript in your project you either need to Licensed under MIT license.ĭeveloped by Valentin Simonov. 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.TouchScript comes with many examples and is extensively documented.TouchScript manages gestures in transform hierarchy and makes sure that the most relevant gesture will receive touch input.TouchScript allows you to write your own gestures and custom pointer input logic.TouchScript includes common gesture implementations: press, release, tap, long press, flick, pinch/scale/rotate.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. Your touch-related code will be the same everywhere.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |