Constrain with drag

fullviewmediafullviewmedia Member Posts: 92
edited November -1 in Working with GS (Mac)
Can someone tell me how to constrain the dragging of an actor within a 200x100px area.

Thanks

Comments

  • InLikeFlynnInLikeFlynn Member Posts: 171
    I think it depends on how you're set up but this works for me:

    if self.position.x > 200
    constrain attribute self.position.x = 200

    ...for each of the 4 borders. if you need it to depend on the starting position you could use a starting point attribute, then use +/-50y or +/-100x to constrain dynamically.
Sign In or Register to comment.