Drag and Drop

zinapsezinapse Member Posts: 34
edited November -1 in Working with GS (Mac)
Hi everyone,

I just got my first Mac for the sole purpose of building iPad games :-)

This should be an easy one for you - I am trying to get click and drag working so my game will work on the web first (will add iPad controls later). I followed the instructions here: http://gamesalad.com/wiki/how_tos:gsc_drag_and_drop_movement but there is no "Self.DragAndDrop" so I used "Movable".
The "Movable' event triggers correctly but setting the Constrain Attribute of self.Position.X to "game.mouse.position.X" doesn't seem to work.

Could you please tell this nube what he is doing wrong, ty :-)

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    You have to create that attribute yourself by clicking the plus button [+] in the Attributes pane of the Actor.
  • zinapsezinapse Member Posts: 34
    thanks Sous Chef however I have just updated my original post as I realised that the "movable" attribute does the job. The problem is that the constrain attribute setting doesn't seem to work. Have a missed a default attribute setting for the actor?
  • RHRH Member Posts: 1,079
    Movable shouldn't do the job as I don't think you can change it whilst the game is being played. As firemaplegames said, you have to create the attribute yourself using the + button.

    Glad to see that you found the wiki and are trying to learn for yourself! The amount of new people that post the simplest questions is ridiculous.

    Good luck!

    EDIT: You can find lots of demo's, you can search for them in the top right hand corner. I actually forgot that I have a drag and drop test that I created for myself a while ago. Feel free to check that out.
  • zinapsezinapse Member Posts: 34
    ty RH (and sorry firemaplegames for calling you Sous Chef - realised what that is now!).

    Yes I am trying to learn from the tutorials and examples but they sometimes skip important steps so I felt I had to ask the question!

    I will try creating the attribute however logically if the movable event is working (I set another behaviour to test it and that worked) then the constraint attribute change should work too.

    I'll let you know the results.
  • RHRH Member Posts: 1,079
    zinapse said:
    Yes I am trying to learn from the tutorials and examples but they sometimes skip important steps so I felt I had to ask the question!

    Haha, I know!
    zinapse said:
    will try creating the attribute however logically if the movable event is working (I set another behaviour to test it and that worked) then the constraint attribute change should work too.

    Heh, I guess if it gives you the outcome you want!
  • zinapsezinapse Member Posts: 34
    OK set the new attribute but the result is the same, which I am actually pleased about as it shouldn't be any different!

    So the issue is that setting "self.Position.X" to "game.Mouse.Position.X" doesn't work.

    I added an "Accelerate Toward" just to prove the Drag and Drop rule was being invoked and that works so there is something wrong with the above settings - any ideas?
Sign In or Register to comment.