iphone drag and drop question

Non-platform specific questions.

iphone drag and drop question

Postby raminjoon » Sun Jul 10, 2011 6:11 am

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.
raminjoon
 
Posts: 40
Joined: Tue Jul 05, 2011 5:34 am
Location: Denver, Co.
Score: 3 Give a positive score

Re: iphone drag and drop question

Postby skydereign » Sun Jul 10, 2011 10:42 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: iphone drag and drop question

Postby raminjoon » Mon Jul 11, 2011 1:53 am

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.
raminjoon
 
Posts: 40
Joined: Tue Jul 05, 2011 5:34 am
Location: Denver, Co.
Score: 3 Give a positive score

Re: iphone drag and drop question

Postby Jagmaster » Mon Jul 11, 2011 2:03 am

// 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.
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest