0
我是iPhone新手,我用CGAffineTransform從上到下設置圖像的動畫,並且當圖像位於(155,50)位置時如何通過這些代碼或其他來源獲取此位置,我想執行一些任務?使用CGAffineTransform動畫化圖像並在指定點獲取CGPoint?
CGRect frameRect=CGRectMake(155, 0, 9, 8);
boxView=[[UIImageView alloc] initWithFrame:frameRect];
boxView.image = [UIImage imageNamed:@"Projectile2.png"];
[self.view addSubview:boxView];
[boxView release];
CGPoint location = CGPointMake(159.5, 500);
[UIImageView beginAnimations:nil context:nil];
[UIImageView setAnimationDelegate:self];
[UIImageView setAnimationDuration:1.5f];
[UIImageView setAnimationCurve:UIViewAnimationCurveEaseInOut];
CGAffineTransform scaleTrans = CGAffineTransformMakeScale(scaleFactor, scaleFactor);
CGAffineTransform rotateTrans = CGAffineTransformMakeRotation(angle * M_PI/180);
boxView.transform = CGAffineTransformConcat(scaleTrans, rotateTrans);
angle = (angle == 180 ? 360 : 180);
boxView.center = location;
[UIImageView commitAnimations];
在此先感謝...