playMaker

Author Topic: [SOLVED]iOS drag object with touch event  (Read 3530 times)

will_brett

  • Junior Playmaker
  • **
  • Posts: 72
[SOLVED]iOS drag object with touch event
« on: February 15, 2013, 09:17:16 PM »
Is there any info on how to drag an object around the screen on an iOS device?

thanks
« Last Edit: February 17, 2013, 09:14:53 PM by will_brett »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: iOS drag object with touch event
« Reply #1 on: February 16, 2013, 02:47:34 AM »
hi,

 Here's a working example using a mouse, you simply need to swap the mouse input with a touch input. that system only asks for a screen position really.

http://hutonggames.com/playmakerforum/index.php?topic=2253.msg9972#msg9972

bye,

 Jean

will_brett

  • Junior Playmaker
  • **
  • Posts: 72
Re: iOS drag object with touch event
« Reply #2 on: February 16, 2013, 01:08:11 PM »
Thank you, I will try this as soon as i've fixed the game

will_brett

  • Junior Playmaker
  • **
  • Posts: 72
Re: iOS drag object with touch event
« Reply #3 on: February 16, 2013, 02:19:24 PM »
Had a look at the FSM (The first one you posted) and the example certainly works however my game is 2d.

How do I adjust it so that the object can only be moved in the X Y axis? Also when I touch my game object it just disappears :S

Thanks again Will

(I used the first link from this page http://hutonggames.com/playmakerforum/index.php?topic=2253.msg9972#msg9972)

will_brett

  • Junior Playmaker
  • **
  • Posts: 72
Re: iOS drag object with touch event
« Reply #4 on: February 17, 2013, 09:13:29 AM »
I still have the issue where on touch of the object it jumps a random number somewhere in the scene in all axis'.

1. I want it constrained to 0 in the Z axis.

2. I dont want it to jump in the either x or y axis... just stay were the object was created until touched and dragged

I've attached screen grabs

Thanks

W
« Last Edit: February 17, 2013, 09:22:11 AM by will_brett »

will_brett

  • Junior Playmaker
  • **
  • Posts: 72
Re: [SOLVED]iOS drag object with touch event
« Reply #5 on: February 17, 2013, 09:15:19 PM »
http://www.youtube.com/watch?feature=player_embedded&v=DFmwLGhfWzY

This video explains what I needed at the end