2011-03-07 88 views
0

我如何在cocos2d中添加動畫在sprite中,問題是每當使用該對象觸發並擊中該對象時,該對象將像動畫一樣移除。如果您有任何教程,則請將plz它發給我...在cocos2d中添加動畫

日Thnx

回答

0

只是用這個

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]]; 
+0

但是有關圖像?我想用圖像使用動畫 – Chandaboy 2011-03-07 07:54:15

0

有很多與未來的cocos2d例子。使用一組圖像包括動畫。看看SpriteTest示例 - 這就是您要找的內容