我有一个应用程序的iphone版本,它从存储在核心数据中的CGPoints在屏幕上绘制线条。所有的图纸都是基于线条的,没有任何填充,所以基本上它画出了从给定点到下一点的线条等。从给定CGPoints调整绘制动画的大小?
现在我正在制作一个iPad版本,并且我想使用相同的点数用我为跟踪屏幕而建立的功能,这是一个很大的工作,所以我希望重用我拥有的相同点)。
是否有任何机构有一个想法,算法或功能用于绘制相同的点'相同的点,但X2大小?
即Draw方法:(把它从苹果GLPaint例子)
- (void) playback:(NSNumber*)index
{
if (p==0) {
pointsCount=[[localpoints objectAtIndex:[index intValue]] count]-1;
}
isPlayBackOn = YES;
LetterPoint *point1 = (LetterPoint*)[[localpoints objectAtIndex:[index intValue]] objectAtIndex:p];
CGPoint p1 = CGPointFromString(point1.float_point);
LetterPoint *point2 = (LetterPoint*)[[localpoints objectAtIndex:[index intValue]] objectAtIndex:p+1];
CGPoint p2 = CGPointFromString(point2.float_point);
[self renderLineFromPoint:p1 toPoint:p2];
p++;
if(p<pointsCount){
[self performSelector:@selector(playback:) withObject:index afterDelay:0.03];
}else {
p=0;
isPlayBackOn = NO;
}
}
感谢
SHANI
嘿,谢谢。这是我第一次不知道答案是什么。 – shannoga 2011-02-20 15:41:04