drag and drop doesn't work :(

eden111eden111 Member Posts: 25
edited November -1 in Working with GS (Mac)
i have tried to do it, but it didn't work (nothing happened)....
can you help me please?

pictures of what i did:

http://i36.tinypic.com/v820jl.png
http://img39.imagefra.me/img/img39/2/10/2/f_v2ghuxqhm_60dd8a9.png

i added DragAndDrop to the attributes and i started my game as default.
what did i do wrong?

tnx in advance

Comments

  • CobraCobra Member Posts: 160
    I'm afraid there is no magic power in naming an attribute "DragAndDrop." ;)

    It looks like you've successfully set up your actor to recognize when it's being touched -- great! Now you'll probably want to do something with that information, such as

    When self.DragAndDrop = 1,
    - constrain self.Position X to mouse.Position X
    - constrain self.Position Y to mouse.Position Y
  • eden111eden111 Member Posts: 25
    tnx very much for your help, but i think i did what you say (look at the second picture).

    http://img39.imagefra.me/img/img39/2/10/2/f_v2ghuxqhm_60dd8a9.png
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    What is happening with it? when you click and hold onto the actor, does it just not move around?
    Everything looks fine assuming the game.Mouse.Position.X and game.Mouse.Position.Y attributes were grabbed from the expression editor and not just typed in.
  • CobraCobra Member Posts: 160
    Oops, excuse me - I didn't see the second picture.

    I just set up a new project with an actor with the same behaviors (as far as I can tell from your pictures), and it works fine. Perhaps there is something else that is interfering?

    As a side note, you can achieve the same thing by just doing this:

    When actor receives event [touch] is [pressed],
    - constrain self.Position X to mouse.Position X
    - constrain self.Position Y to mouse.Position Y
  • eden111eden111 Member Posts: 25
    thank you very much CodeMonkey!
    The mouse positions weren't grabbed from the expression editor...

    thank you cobra also!
  • CobraCobra Member Posts: 160
    *shakes fist at CodeMonkey* ;)
Sign In or Register to comment.