0
\$\begingroup\$

I want to pull a sprite from point A(vector2) to point B(vector2) in my Windows Phone XNA game. GestureType.HorizontalDrag moves it horizontally and GestureType.VerticalDrag moves it vertically, how can I move the sprite diagonally?

The player should be able to pull the sprite in every direction if he touches the sprite with his finger. The sprite can't be moved if the player's finger isn't on the sprite.

How can I do that? How can I move an object diagonally on Windows Phone?

\$\endgroup\$
  • \$\begingroup\$ diagonal=vertical+horizontal. \$\endgroup\$ – Jemmy Dec 14 '13 at 0:30
0
\$\begingroup\$

There is GestureType.FreeDrag that may do what you want (MSDN).

Otherwise, it may be worth implementing your own touch behaviour using TouchPanel.GetState()

\$\endgroup\$
  • \$\begingroup\$ Thanx. It works. \$\endgroup\$ – Homer_Simpson Dec 14 '13 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.