 |
 |
|
 |
11-13-2008, 04:11 PM
|
#1 (permalink)
|
|
Junior Member
Join Date: Nov 2008
Posts: 12
Rep Power: 0
|
Capturing Coordinates of a continous touch
Hey guys, heres what I am working on.
I need to capture the coordinates of a continuous touch as it happens at the fastest frame rate possible. Can something be done with calls to touches moved? As in storing each successive coordinate captured into an array? Thanks again!
|
|
|
11-13-2008, 04:56 PM
|
#2 (permalink)
|
|
Senior Member
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,121
Rep Power: 3
|
Sure. Did you try it? In the time you posted and got a response you could have answered this yourself by trying it first.
|
|
|
11-13-2008, 05:24 PM
|
#3 (permalink)
|
|
Junior Member
Join Date: Nov 2008
Posts: 12
Rep Power: 0
|
Well that is as far as I got by thinking about it, I've been looking around the help files for an idea on how to implement it and the idea I have is using
- (CGPoint)locationInView  UIView *)view
to return the location of the touch in time intervals, but I have had a hard time implementing it.
I am new to developing so what is simple to some is still complicated for me. I figure this is part of the learning process and wont last long so if someone knows of a better way to do this in the SDK I would greatly appreciate it! Thanks guys.
|
|
|
11-13-2008, 05:29 PM
|
#4 (permalink)
|
|
Senior Member
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,121
Rep Power: 3
|
Be more specific about what you have and what's not working. Show some code. Show what errors (if any) you get compiling the code. It's a lot easier to offer help when there is something concrete to talk about. We were all new once. One of the important skills needed by anyone, especially newer programmers, is how to ask good questions and be clear on what is needed.
|
|
|
11-13-2008, 05:32 PM
|
#5 (permalink)
|
|
Senior Member
Join Date: Sep 2008
Posts: 154
Rep Power: 1
|
heres a way to track the coordinates of where you move your finger:
- (void)touchesMoved  NSSet *)touches withEvent  UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInView:self];
NSLog(@"%f", location.x);
NSLog(@"%f", location.y);
}
Then instead of nslogging you can store those in an array for later use or whatever else you want to do with them.
|
|
|
11-13-2008, 05:36 PM
|
#6 (permalink)
|
|
Junior Member
Join Date: Nov 2008
Posts: 12
Rep Power: 0
|
(to RickMaddy) you're right, I was just thinking that after I posted.
I need to get continuous coordinates for a touch while it is moving so I am trying to call locationInView during touchesMoved and saving it to a point with.
Point a;
a = locationInView;
or a = locationInView(nil) to get the coordinate in reference to the whole window.
I get an error "'locationInview' undeclared (first use in this function)
Is touchesMoved the right place to be trying to get this information? Thanks.
|
|
|
11-13-2008, 05:44 PM
|
#7 (permalink)
|
|
Junior Member
Join Date: Nov 2008
Posts: 12
Rep Power: 0
|
Thanks! I really appreciate it. I once again apologize for not wording my question right, it wont happen again! This information has been a huge help and Ive learned a lot.
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
|
» Online Users: 265 |
| 25 members and 240 guests |
| amoll, bensj, BostonMerlin, crossfire, dapis, DGuy, Dracor, Groucho, heinrich, idigit, Jeremy1026, Jume, kaleman, lastiko, lildragon, mattjgalloway, mnemonic_fx, odysseus31173, Oliver Drobnik, Opticfibre, shabzcohelp, Sicga, tonylmiller, utopiaplan, wolkje |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 8,229
Threads: 20,197
Posts: 90,213
Top Poster: RickMaddy (2,121)
|
| Welcome to our newest member, jrsiqueira |
|