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

View Single Post
Old 04-01-2009, 01:36 AM   #39 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

Quote:
Originally Posted by .mb View Post
Agh. I feel stupid. It was working the whole time. The problem is that it was affecting the center of the object, which is used for spawning, not movement. So, how could I affect the already made object with my move to touch code?
You want to touch an object an move it? Like dragging?

You can either set up the objects themselves to respond to touches, like I said above, or handle it all here in the SiegeViewController.

To handle it here in the SiegeViewController, you'll have to set up so:

(1)You have a pointer to store the currently selected object.
(2)on touchesBegan, you look through your array of objects and find the nearest one to the touch point (pythaorean theorem.) Make that the currently selected object.
(3)On touchesMoved, move the currently selected object to the touch point.
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Online Users: 283
20 members and 263 guests
ADY, apatsufas, BdR, catedawn, Duncan C, F_Bryant, Graham, Gurpartap Singh, iDifferent, iph_s, jorge599, kampftrinker, mer10, mizzytheboy, Naughty_Ottsel, RoryHarvey, superg, syver, themathminister
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,700
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:21 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.