2013-09-27 3 views
0

Я использую две анимации в своем объективном проекте C. Кажется, я не работаю, используя apportable. Первые методы будут поддерживаться?CAKeyframeAnimation в Appportable

, если (тег == 1) { CAKeyframeAnimation * анимационной = [CAKeyframeAnimation animationWithKeyPath: @ "положение"]; animation.duration = 3; animation.removedOnCompletion = YES; animation.fillMode = kCAFillModeForwards; animation.repeatCount = 1; // repeat forever animation.autoreverses = NO; animation.rotationMode = kCAAnimationRotateAuto; animation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]; animation.calculationMode = kCAAnimationCubic;

UIBezierPath *curvedPath = [UIBezierPath bezierPath]; 
    CGPoint cp; 
    cp.x=100; 
    cp.y=100; 
    [curvedPath moveToPoint:CGPointMake(300,300)]; 
    [curvedPath addLineToPoint:cp]; 

    animation.path=curvedPath.CGPath; 
    animation.delegate=self; 
    //self.alpha=0; 
    [ivcontainer.layer addAnimation:animation forKey:NULL]; 
} 
else 
{ 
    ivcontainer.center=CGPointMake(300,300); 
    [UIView beginAnimations:NULL context:NULL]; 
    [UIView setAnimationDuration:3]; 
    [UIView setAnimationRepeatCount:1]; 
    CGPoint cp; 
    cp.x=100; 
    cp.y=100; 
    ivcontainer.center=cp; 
    [UIView commitAnimations]; 
} 

ответ

0

Позвольте мне перефразировать мой вопрос. Если кажется, мой вопрос обрезался.

Я использую две анимации в своем объективном проекте C. Кажется, я не работаю, используя apportable. Если part - это первый метод, else - второй метод. Будет ли это поддерживаться?

, если (тег == 1) { CAKeyframeAnimation * анимационной = [CAKeyframeAnimation animationWithKeyPath: @ "положение"]; animation.duration = 3; animation.removedOnCompletion = YES; animation.fillMode = kCAFillModeForwards; animation.repeatCount = 1; // repeat forever animation.autoreverses = NO; animation.rotationMode = kCAAnimationRotateAuto; animation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]; animation.calculationMode = kCAAnimationCubic;

UIBezierPath *curvedPath = [UIBezierPath bezierPath]; 
    CGPoint cp; 
    cp.x=100; 
    cp.y=100; 
    [curvedPath moveToPoint:CGPointMake(300,300)]; 
    [curvedPath addLineToPoint:cp]; 

    animation.path=curvedPath.CGPath; 
    animation.delegate=self; 
    //self.alpha=0; 
    [ivcontainer.layer addAnimation:animation forKey:NULL]; 
} 
else 
{ 
    ivcontainer.center=CGPointMake(300,300); 
    [UIView beginAnimations:NULL context:NULL]; 
    [UIView setAnimationDuration:3]; 
    [UIView setAnimationRepeatCount:1]; 
    CGPoint cp; 
    cp.x=100; 
    cp.y=100; 
    ivcontainer.center=cp; 
    [UIView commitAnimations]; 
} 
+0

отредактируйте этот вопрос – LearnCocos2D

Смежные вопросы