Iphone 在cocos2d中添加动画

Iphone 在cocos2d中添加动画,iphone,cocos2d-iphone,Iphone,Cocos2d Iphone,如何在精灵的cocos2d中添加动画,问题是,每当使用激发对象并命中该对象时,该对象将像动画一样移除。。如果你有任何教程,请发送给我 thnx用这个就行了 CCSpriteSheet *mgr = [CCSpriteSheet spriteSheetWithFile:@"yourImage.png" capacity:5]; [self addChild:mgr z:0 tag:4]; //set the image and load it to the CCLayer

如何在精灵的cocos2d中添加动画,问题是,每当使用激发对象并命中该对象时,该对象将像动画一样移除。。如果你有任何教程,请发送给我

thnx

用这个就行了

    CCSpriteSheet *mgr = [CCSpriteSheet spriteSheetWithFile:@"yourImage.png" capacity:5];
    [self addChild:mgr z:0 tag:4];    //set the image and load it to the CCLayer

    sprite = [CCSprite spriteWithTexture:mgr.texture rect:CGRectMake(0, 0, 30, 30)];
    [sprite runAction:[CCFadeTo actionWithDuration: 1 opacity:80]];

cocos2d有很多例子。包括使用一组图像的动画。看一看SpriteTest示例-这就是您要查找的内容

您可以使用图像的spritesheet,然后使用图像制作动画

有关代码示例,您可以尝试以下教程


但是图像呢?我想使用图像动画