0 Favourites

How do I detect multi touch simultaneously?

  • I want to detect the location of touch on different side of the screen.

    The basic idea is that:

    Touch: Is in touch:

    Touch.X<(LayoutWidth/2) : Set var1 to Touch.X

    Touch.X>(LayoutWidth/2) : Set var2 to Touch.X

    How do I get the system to recognize different Touch.X?

    Currently when I touch one side of the screen the other side wouldn't register.

  • From the manual:

    Multi-touch

    The Touch object supports multi-touch. This is most useful with the On touched object and Is touching object conditions, which can for example detect if multiple on-screen touch controls are being used. This is sufficient for many games.

    For more advanced uses, the TouchID, XForID and YForID expressions can be used to track individual touches for different purposes. Each touch has a unique ID (which is an arbitrary number), and can be accessed using the TouchID expression in an event like On any touch start. The touch ID can then be stored in a variable and tracked using the XForID and YForID expressions. Finally comparing the TouchID in On any touch end indicates when that touch has been released.

  • I read about that part. How do I find TouchID? Do I define it myself?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Each touch has a unique ID (which is an arbitrary number), and can be accessed using the TouchID expression in an event like On any touch start. The touch ID can then be stored in a variable and tracked using the XForID and YForID expressions. Finally comparing the TouchID in On any touch end indicates when that touch has been released.

    So on touch start you can get the id for that touch..

    Touch.TouchID is this id..

    The touch zooming example and the touch rotating example shipped with Construct2 show examples of multitouch..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)