Page 1 of 1

iphone drag and drop question

PostPosted: Sun Jul 10, 2011 6:11 am
by raminjoon
oK guys lets say i have a ball on screen where its sits still and on iphone platform as it is touch screen. I want to be able to put my finger on the ball and drag it around and have it be putted back whenever my finger is off the screen how would I do that.

also one more thing, I have set all my buttons on screen buttons would that be touch screen automatically on touch screen phones or do i need to do some coding on that and how does that work?

thanks you all for your great helps.

Re: iphone drag and drop question

PostPosted: Sun Jul 10, 2011 10:42 am
by skydereign
By put back, do you mean to its original position? Or do you mean when you let go it stays where it was last before you lifted your finger? If the latter just have a mouse button down event for the ball, and when you click to set it to be left click you should see Drag: [Disable], set that to enable. You need to add a script for gE to accept the event, so use this.
ball -> Mouse Button Down Left (Drag enabled) -> Script Editor
Code: Select all
//


For touchscreen controls, all it is are mouse button down events. So if you want to code for a button on a touch screen, it is the same as coding a click on a normal screen.

Re: iphone drag and drop question

PostPosted: Mon Jul 11, 2011 1:53 am
by raminjoon
friend thanks for your info but the problem is that i dont understand what do you mean by // because that script does nothing and you havent typed the script in your post can you please send me the script? I appreciate it.

Re: iphone drag and drop question

PostPosted: Mon Jul 11, 2011 2:03 am
by Jagmaster
// means nothing. It's a comment. Anything after // will be ignored. The reason he put this in is because Ge recognizes it as something and it won't allow empty script.
Code: Select all
//this means nothing copy into code.


mousedown is an event. It has an extra built in function called drag. You can also do it as an action. mousedown->(action)followmouse, both. Mouseup -> (action)followmouse none.