FadeTo动画不起作用。的cocos2d

时间:2014-07-29 12:16:25

标签: objective-c cocos2d-iphone fade ccnode

根据这个代码节点必须慢慢出现,对吧?它不起作用。有什么问题?

   CCNodeColor *_backNode = [CCNodeColor nodeWithColor:[CCColor colorWithRed:0 green:0 blue:0    alpha:1.0f]];
    _backNode.opacity=0;
    [self addChild:_backNode z:5];
  [_backNode runAction:[CCActionFadeTo actionWithDuration:2 opacity:0.9]];

1 个答案:

答案 0 :(得分:0)

尝试使用alpha = 0并且不设置不透明度:

CCNodeColor *_backNode = [CCNodeColor nodeWithColor:[CCColor colorWithRed:0 
                                                                    green:0
                                                                     blue:0
                                                                    alpha:0.0f]];