constrain to mouse position question..

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

Obviosuly, constraining the x and y positions of the actor to the x and y positions of the mouse will let you drag the actor. When touching your new draggable actor in the center it's fine, but when you touch it near its corners then the actor will actually move slightly to that position.

How do I make it so that a draggable actor can be touched anywhere and it will maintain it's current position until it is dragged?

Comments

  • old_kipperold_kipper Member Posts: 1,420
    grab and store the difference of the x and y of the actor and the mouse position as it touches the actor in a pair of integer attributes and then when you constrain the actor to the mouse subtract those values from its position as it moves in the constrain rule.
Sign In or Register to comment.