Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: will_brett on February 15, 2013, 09:17:16 PM

Title: [SOLVED]iOS drag object with touch event
Post by: will_brett 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
Title: Re: iOS drag object with touch event
Post by: jeanfabre 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
Title: Re: iOS drag object with touch event
Post by: will_brett on February 16, 2013, 01:08:11 PM
Thank you, I will try this as soon as i've fixed the game
Title: Re: iOS drag object with touch event
Post by: will_brett 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)
Title: Re: iOS drag object with touch event
Post by: will_brett 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
Title: Re: [SOLVED]iOS drag object with touch event
Post by: will_brett 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