 |
 |
|
 |
11-13-2008, 04:11 PM
|
#1 (permalink)
|
|
New Member
Join Date: Nov 2008
Posts: 12
|
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)
|
|
New Member
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,121
|
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)
|
|
New Member
Join Date: Nov 2008
Posts: 12
|
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)
|
|
New Member
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,121
|
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)
|
|
Registered Member
Join Date: Sep 2008
Posts: 176
|
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)
|
|
New Member
Join Date: Nov 2008
Posts: 12
|
(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)
|
|
New Member
Join Date: Nov 2008
Posts: 12
|
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: 385 |
| 28 members and 357 guests |
| abidins, activ8, aniuco, appbox, ataranlen, BSDimwit, chouchou, CHV, dkern, DonomaGames, Dracor, gbaldwin9, gedalia, iamjiex, javaconvert, joalta, JoshuaCaputo, kiancheong, Kyowoo, lukeca, Nori, Notable, pereorra, racer_X, sayer, scatterbrn, Shagpile, vargonian |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 24,145
Threads: 38,923
Posts: 170,776
Top Poster: smasher (2,565)
|
| Welcome to our newest member, user314159 |
|