Hey everyone. This is my first post on the forums, getting my feet wet with Unity iPhone - really enjoying it thus far. I’ve looked through a lot of posts, the FAQ post at the top of this forum as well, and haven’t found a working solution to what I’m trying to do. It’s quite simple on paper, implementation for me right now is what is keeping me scratching my head.
How do I simply get a 2D Texture of mine to scale it’s Height and Width depending on multitouch, that’s simply all I’m looking for. The Scripting Reference isn’t much help to me so far either with this issue.
function Update()
{
if ( iPhoneInput.touchCount == 2 )
{
var touch1 : iPhoneTouch = iPhoneInput.GetTouch( 0 );
var touch2 : iPhoneTouch = iPhoneInput.GetTouch( 1 );
if ( touch1.position.x < touch2.position.x )
Brayden.width -= ( touch1.deltaPosition.x - touch2.deltaPosition.x ) / 10;
if ( touch1.position.x > touch2.position.x )
Brayden.width += ( touch1.deltaPosition.x - touch2.deltaPosition.x ) / 10;
if ( touch1.position.y < touch2.position.y )
Brayden.height -= ( touch1.deltaPosition.x - touch2.deltaPosition.x ) / 10;
if ( touch1.position.y > touch2.position.y )
Brayden.height += ( touch1.deltaPosition.x - touch2.deltaPosition.x ) / 10;
}
}
Any help would be greatly appreciated! I could be far off base with my small attempt at this, any direction would help though.
Thanks,
Brayden