Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-07-2010, 05:37 PM   #26 (permalink)
Registered Member
 
wilky94's Avatar
 
Join Date: Dec 2009
Location: Seaham UK
Age: 17
Posts: 257
Send a message via AIM to wilky94 Send a message via Skype™ to wilky94
Default

Quote:
Originally Posted by harrytheshark View Post
So you still need to compare where the touch is.
How do I do that?
wilky94 is offline   Reply With Quote
Old 02-07-2010, 05:42 PM   #27 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: UK
Posts: 1,886
Default

Like I've said a few times, get the X and Y values for the object you want to move, and get the values for the touch.

Then using a simple if statement compare them:
Code:
if (touch x and y are on object){
  //move object
}
harrytheshark is offline   Reply With Quote
Old 02-07-2010, 05:48 PM   #28 (permalink)
Registered Member
 
wilky94's Avatar
 
Join Date: Dec 2009
Location: Seaham UK
Age: 17
Posts: 257
Send a message via AIM to wilky94 Send a message via Skype™ to wilky94
Default

Quote:
Originally Posted by harrytheshark View Post
Like I've said a few times, get the X and Y values for the object you want to move, and get the values for the touch.

Then using a simple if statement compare them:
Code:
if (touch x and y are on object){
  //move object
}
do I need something like
Code:
 if (touch.x, touch.y= one) {

}
wilky94 is offline   Reply With Quote
Old 02-07-2010, 05:50 PM   #29 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: UK
Posts: 1,886
Default

Yeah kind of
harrytheshark is offline   Reply With Quote
Old 02-07-2010, 05:54 PM   #30 (permalink)
Registered Member
 
wilky94's Avatar
 
Join Date: Dec 2009
Location: Seaham UK
Age: 17
Posts: 257
Send a message via AIM to wilky94 Send a message via Skype™ to wilky94
Default

Quote:
Originally Posted by harrytheshark View Post
Yeah kind of
Code:
if (touch.x, touch.y = one) {
		
	}
request for member 'x' in 'touch' which is in a non-class type of 'UITouch'

do you know the exact code?

I will have to get back to you tomorrow please reply.

Last edited by wilky94; 02-07-2010 at 06:05 PM.
wilky94 is offline   Reply With Quote
Old 02-08-2010, 01:05 PM   #31 (permalink)
Registered Member
 
wilky94's Avatar
 
Join Date: Dec 2009
Location: Seaham UK
Age: 17
Posts: 257
Send a message via AIM to wilky94 Send a message via Skype™ to wilky94
Default

Quote:
Originally Posted by wilky94 View Post
Code:
if (touch.x, touch.y = one) {
		
	}
request for member 'x' in 'touch' which is in a non-class type of 'UITouch'

do you know the exact code?

I will have to get back to you tomorrow please reply.
I got it working you need:
Code:
if (CGRectContainsPoint(one.frame, location)) {
	
		one.center = location;
		
	}
wilky94 is offline   Reply With Quote
Reply

Bookmarks

Tags
dodging, game, image

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 316
19 members and 297 guests
@sandris, ADY, dacapo, Dani77, djohnson, dre, HDshot, HemiMG, JasonR, MarkC, mer10, nibeck, prchn4christ, ryandb2, spiderguy84, timle8n1, tomtom100, vogueestylee
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:05 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0