playMaker

Author Topic: Object on Android  (Read 2105 times)

Mikie

  • Playmaker Newbie
  • *
  • Posts: 13
Object on Android
« on: April 24, 2012, 05:56:36 PM »
I would like to touch an object on my android and be able to move the object with my finger.  Can this be a done?

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Object on Android
« Reply #1 on: April 26, 2012, 02:56:11 PM »
sure can

Just use the "touch object event" action to check when the object first gets "touched"
https://hutonggames.fogbugz.com/default.asp?W680

then have it transition to a state that constantly updates the position (set position) of your finger location (which you will get from the "get touch info" action
https://hutonggames.fogbugz.com/default.asp?W579

so state 2 would have
Get touch info (save the x and Y value into a variable)
and "set position" (using the saved x and Y variable data)

Make sure your camera is set to view your game from the side, because Y is up (if you are looking from a top down view the get touch info would be looking at the wrong axises)

You could also add another get touch info action to state 2 and have it do something else once you let go of your finger too if you want.