Constrain actor size to drag gesture?

jonnyDiamondjonnyDiamond Member Posts: 11
edited November -1 in Working with GS (Mac)
Hi,

I have a tricky function that I cant solve. Here goes...

I want to control the size of an actor by touching it and dragging towards its center. As you touch the edge of the actor and drag towards its center - it gets smaller. As you drag outwards, away from its center - it gets bigger.

Currently I am able to track the x and y of a touch when you touch the actor but I can't figure out how to constantly measure the distance of the touch to the actors center. Also, I am not sure how to measure the distance as the touch drags away from the actor, because the touch may drag outside of the actor which means I may lose the x and y of the touch.

Am I approaching this the right way?

Any help will be greatly appreciated. Thanks

Comments

Sign In or Register to comment.