Really frustrating drag and drop problem!!

FrozenDingoFrozenDingo Member Posts: 17
edited November -1 in Working with GS (Mac)
I have an actor that can be dragged and dropped by touching the screen.

If placed on the first half of the 1024 pixel scene it works fine. However, when placed where I want it to start - on the second half, every time you touch it it jumps to the left. It's far enough that it cannot be placed where intended as it will jump when you try to pick it up again.

Anyone have any ideas what's wrong?!

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    if the camera is not at 0,0 touch and mouse coordinates need to have an offset. So instead of constraining to touch.1.x you need to constrain to touch.1.x+camera.origin.x
  • FrozenDingoFrozenDingo Member Posts: 17
    Thanks!

    I'm just not quite sure how I should put it in (new at this!).

    At the moment I have -

    When touch is pressed - Constrain Attribute: self.Position.X To : game.Mouse.Position.X

    and the same for Y.
  • FrozenDingoFrozenDingo Member Posts: 17
    Got it!! :)
Sign In or Register to comment.