HELPP PLEASE! Specifying touch

0 favourites
  • 11 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • After running through tutorial, manuals and forums, and pm'ing, I guess i will have to ask this out here..

    How to limit action from taking the coordinate of a specific touch?

    eg.

    capx

    <img src="https://dl.dropbox.com/u/32679138/My%20Question.jpg" border="0">

    <img src="https://dl.dropbox.com/u/32679138/touch%20question2.png" border="0">

    <img src="https://dl.dropbox.com/u/32679138/touch%20question3.png" border="0">

    the intention here is to move the playerbox ONLY when the touching the "Control" sprite & move the player towards the direction that ONLY THAT touch generates!

    However, I failed to limit the "action" to take touch.x, and touch.y from ONLY the touch that touches "Control" sprite.

    PS:To reproduce this "Error" in capx, you will have to touch outside of the "control sprite" first, and then proceed to touch the control. playerbox will move in the direction to the touch that is not touching the "control sprite" as opposed to move in direction to the touch that is touching the "control sprite".

  • Touch.X and Touch.Y always takes the coordinate of the first touch.

    How do we get the coordinate of 2nd, 3rd, and 4th touches?

  • Hello? anybody there..?

  • 1. Describe what the end result is suppose to be.

    2. Describe the problem you have with the implementation.

  • Julmust

    Thanks for taking interest in my problem.

    P.S.: Touchpad is named "Control" sprite in the picture.

    I was planning to set up 2 touch-analog control stick for player1, and player2.

    Each player touches their "Touchpad" and control their own respective players.

    I plan to achieve this by moving the playerbox at the angle between origin of "Touchpad" and the coordinate of Touch.

    (Move player 5 pixel by(angle(touchpad.x,touchpad.y,touch.x,touch.y)

    This implemention failed because other touches that is not touching touchpad influence the direction of player movement too.

    Conclusion of my problem: I want to limit the expression touch.x,touch.y, to the touch that only touches the touchpad.

  • Still desperately waiting for answer.

    Does construct 2 has expression for coordinate of each touch?

    for example the famous multi touch plugin allows expression of

    TouchX(0) First touch

    TouchX(1) Second touch

  • You need to use TouchforID. This will mean the sprite is only effected by touches on it....and no other touch. I have an example if you still need it.

  • Kenhes got it. AFter months of working on this problem Ahsley put in the ForId. It is mandatory to make touch controls work correctly.

    The alternative is to use a drag and drop box, but it has a caveat to watch for :P

  • kenhes TouchforID ? that's new to me!

    How do we use it exactly?! I want to know!!

    (Did a quick search on the forum, no thread about TouchforID yet!)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's an example in this thread. See the last image for the most up to date.

    Touch ID

  • kenhes Got it! Thank you very much!

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