我在循环中添加 CCMenuItems,然后使用 EaseIn 在屏幕上移动 CCMenu。有没有办法单独移动每个 CCMenuItem?
CGSize winSize = [[CCDirector sharedDirector] winSize];
CCMenu *chapterMenu = [CCMenu menuWithItems: nil];
for(int i =1; i<=5; i++){
CCMenuItem *chapter = [CCMenuItemSprite itemFromNormalSprite:[CCSprite spriteWithFile:@"sprite.png" rect:CGRectMake(0, 0, 150, 210) selectedSprite:nil disabledSprite:nil target:self selector:@selector(OnPlay:)];
chapter.tag = i;
[chapterMenu addChild:chapter];
}
[chapterMenu alignItemsHorizontallyWithPadding:40];
chapterMenu.position = ccp(chapterMenu.position.x, chapterMenu.position.y + winSize.height);
id action = [CCMoveBy actionWithDuration:0.5f position:ccp(0, -winSize.height)];
id ease = [CCEaseIn actionWithAction:action rate:1.5f];
[chapterMenu runAction:ease];
[self addChild:chapterMenu];