Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7926291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:43:47+00:00 2026-06-03T18:43:47+00:00

I created a new project with cocos2d, and then create a layer and a

  • 0

I created a new project with cocos2d, and then create a layer and a sprite.
I am trying to apply an animation to my sprite, and I found some samples about that. But I don’t understand the difference between CCAnimation and CCAnimate, so I haven’t applied any animation for my sprite yet.

What is the difference between these two and what is the real meaning of them? How to use them?

Can any one explain me about that? Please help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T18:43:48+00:00Added an answer on June 3, 2026 at 6:43 pm

    Here is code from “Working with Sprites, and Sprite batch nodes” in cocos2d-iphone Programming Guide:

    ......
    
    NSMutableArray *animFrames = [NSMutableArray array];
    for(int i = 1; i < 15; i++) {
        CCSpriteFrame *frame = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"grossini_dance_%02d.png",i]];
        [animFrames addObject:frame];
    }
    CCAnimation *animation = [CCAnimation animationWithName:@"dance" delay:0.2f frames:animFrames];
    [sprite runAction:[CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:animation restoreOriginalFrame:NO]]];
    

    As you can see, you need to use both CCAnimate and CCAnimation to run a CCSpriteFrame-based animation on the sprite. Per description of CCAnimation:

    The CCAnimation object contains CCSpriteFrame objects, and a possible delay between the frames. You can animate a CCAnimation object by using the CCAnimate action. Example:

    [sprite runAction:[CCAnimate actionWithAnimation:animation]]; 
    

    Generally speaking, CCAnimation is a wrapper of frame container. CCAnimate is the action that the sprite need to do – in fact it is a subclass of CCAction, which represents an action that a sprite can “run”, such as moving, jumping, rotating, etc. You can use its other subclasses to do some kinds of animation on your sprite without creating the frames yourself. Have a try with something like CCFadeIn, CCRotateBy, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create a new project based on cocos2d-box2d, and there are always 4 warning
I created a new project, then I clicked on Import to Subversion repository but
I created a new xna 3.1 project, and copied some source code from a
I created New Project -> Tab Bar Application. Then i changed from @interface FirstViewController
I created a new project using aspx visual studio 2010. All I am trying
I've noticed something interesting about Zend Framework's bootstrap. I created a new project and
i'm using eclipse platform and window builder pro within. I've already created new project
I created a new project with the following code segment: char* strange = (Strange??);
I created a new project in Eclipse called Lottery. The first thing that happened
I've created a new project in VS2008, and added a .MDF file to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.