This is the next question for my first queries regarding plist data. Right now, I was able to detect how users come into contact with my viewing with randomly handling the image (thanks to phytonquick).
CGPoint currentTouchLocation = [currentTouch locationInView:self];
I'm now having problems with how to compare the value that I received from user touches made on a random image in the view, before saving the plist data with the same name as the random image that users touch. I know how to calculate the touch distance so that I can adjust the hit points.
-(CGFloat) distanceBetween: (CGPoint) point1 and: (CGPoint)point2
NSMutableDictionary *????? = [self loadDictionaryFromPList: @"?????"];
NSNumber *1stXCoordinate = [????? objectForKey:@"1stXCoordinate"];
NSNumber *1stYCoordinate = [????? objectForKey:@"1stYCoordinate"];
if (1stXCoordinate && 1stYCoordinate)
{
CGPoint 1stTouchLocation = CGPointMake([lastXCoordinate floatValue], [lastYCoordinate floatValue]);
CGFloat distanceBetweenTouches = [self distanceBetween: currentTouchLocation and: 1stTouchLocation];
if (distanceBetweenTouches < 20)
{
NSLog(@"You hit it.");
}
}
, plist. (, "iphone 3 dev" ), , . :
randImage <-- callout array
p1.jpg <-- image represented by array
tap1 <-- Array
item 1 - x1 coordinate <-- Number
item 2 - y1 coordinate <-- Number
item 3 - x2 coordinate <-- Number
item 4 - y2 coordinate <-- Number
item 5 - x3 coordinate <-- Number
item 6 - y3 coordinate <-- Number
tap2 <-- Array
item 1 - x1 coordinate <-- Number
item 2 - y1 coordinate <-- Number
item 3 - x2 coordinate <-- Number
item 4 - y2 coordinate <-- Number
p2.jpg <-- image represented by array
tap1
item 1....etc
-, , , . .