Coder Social home page Coder Social logo

Comments (5)

valyard avatar valyard commented on July 19, 2024

Hi.

In general you could use TouchPoint.Position which is a coordinate in screen space. But the library was built to abstract from touch points but use gestures and clusters of points instead. All the gestures got ScreenPosition property which is a current centroid of the gesture's cluster on screen.

I don't know if you were the person who asked this at the forums but currently for TapGesture when it's recognized it's not possible to find out where on screen it happened. I'm thinking about how to implement this functionality in a nice way.

As for JavaScript, sorry it doesn't work with JS because of how Unity handles scripts compilation.

from touchscript.

tro1ka avatar tro1ka commented on July 19, 2024

Thanks for the quick response.

So, if i want to rotate an object at the same speed and direction of the touchpoint i'll have to use the Rotate gesture?

from touchscript.

valyard avatar valyard commented on July 19, 2024

mmm... you mean like if you had a cylinder and tried to rotate it with one figer over its axis? in this case you need to write a modified pan gesture or use pan gesture and compute angle from distance moved manually.

from touchscript.

tro1ka avatar tro1ka commented on July 19, 2024

Thanks, i'll see what comes up.

from touchscript.

valyard avatar valyard commented on July 19, 2024

Hello again.

Please try the latest develop branch. TapGesture now correctly returns ScreenPosition from Recognized handler.
And there's a new method GetCentroidHitResult which casts a ray from current screen position and returns if it has hit the same target and where.

from touchscript.

Related Issues (20)

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.