Multitouch

robert.mccarthyrobert.mccarthy Member Posts: 165
edited November -1 in Working with GS (Mac)
Hello All,

I was wondering if there was a tutorial on multi-touch to move and 'rotate' an actor?

I know how to get multi-touch working for two seperate actors, but need to know how to get it to work out how it will rotate an actor when I select it.

Thanks,

Comments

  • Big Dog StudiosBig Dog Studios Member, PRO Posts: 18

    make two attributes spinX and spinY
    create an invisible actor with rule:

    when touch is pressed,
    Constrain self.positionY to touchY,
    Constrain self.positionX to touchX,

    Constrain game.spinY to self.positionY,
    Constrain game.spinX to self.positionX,

    Spinning:

    When touch is pressed and inside
    constrain self.rotation to VectorToAngle(self.positionX-game.spinX, self.position.Y-game.spinY)

    Hope this helps....

Sign In or Register to comment.