Author Topic: Problem zooming a Texture from the current touch or mouse position (not pivot)  (Read 3111 times)

bdominguez

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 38
    • View Profile
Hi,

My setup is:

- DraggablePanel (with clipping and restrict within bounds enabled)
    - Texture with: UIDragPanelContents and BoxCollider

My problem is that with "OnScroll" method is easy to zoom from the pivot of the texture.

The hard way is doing that from the current touch (pinch, center of the two touch points) or mouse position.

I don't know how to do that.

Help please!!

OnlineCop

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 51
    • View Profile
Are you talking about a combination between http://www.danielhanly.com/blog/tutorial/pinch-to-zoom-through-unity3d-on-ios/ and (non-Unity, but the math is the same) http://adtsai.blogspot.co.uk/2010/09/pinch-zooming-using-xna4-on-wp7-getting.html ?

So you can pinch-zoom around your finger coordinates instead of the texture's center?

N3uRo

  • Guest
Are you talking about a combination between http://www.danielhanly.com/blog/tutorial/pinch-to-zoom-through-unity3d-on-ios/ and (non-Unity, but the math is the same) http://adtsai.blogspot.co.uk/2010/09/pinch-zooming-using-xna4-on-wp7-getting.html ?

So you can pinch-zoom around your finger coordinates instead of the texture's center?

Yes, exactly.

I don't understand the purpose of the first link. It's not enough with the second link?

Thanks!