Multitouch Drag And Rotate Demo

arantesarantes Member Posts: 5
edited November -1 in Working with GS (Mac)
Dear GS-Fanatics,

I'm kinda new to GameSalad and having some problems with my project. I used and project called: "Multitouch Drag And Rotate Demo" as the start of my project. I don't know the 'online' link to this project but you could find him in gamesalad with this name.

I would like to fix 2 bugs I have in my game.

1) I can drag and rotate the elements, but when I start rotating the element and my mouse is getting of the element without having released it, it keeps rotating. I would like to stop the element rotating when te mouse is of the element. I couldn't figure out a right way to recognize when it's of the element because it's a little but buggy I think.

2) with the center of the element I could drag and drop him but I would like to manipulate the part of the element wich could be used for rotation. It's sometimes not really clear wich part of the element is used for rotation and wich part is used for drag and drop.

Maybe this image could help u out:
[img]http://img291.imageshack.us/img291/21/dragandrotate.jpg[/img]

I want the middle part to be used to drag the element and the handles on the outside to rotate the element. Maybe someone knows a better script or better way to make this work?

Thank you in advance!

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    I do not understand a lot of things in that demo... perhaps they affect out aspects of the project.

    if I were doing a simple a bar like your image...

    Rule when
    touch is pressed
    --Rule (Any) when
    ----Attribute touch1.Position.X is > self.Position.X +25 (and here you have to figure out the size of Right side of the image you want to cause rotation)
    ----Attribute touch1.Position.X is < self.Position.X -25 (and here you have to figure out the size of Left side of the image you want to cause rotation)
    ----Rotate
    ----Otherwise:
    ----- your drag rules...constrain X and Y to touch X and Y

    and that is single touch coding...
    MH
  • arantesarantes Member Posts: 5
    TshirtBooth, Like I said earlier, thank you very much! this is exactly what I was looking for!

    MotherHoose I also want to thank you for the post! I learned a lot from your code and allready planned to use it somewhere!

    Time to make a good game ;)!
Sign In or Register to comment.