Cocos2d-x action Spawn (CCSpawn)

Source: Internet
Author: User

First, Spawn is a simultaneous action, and Sequence is a sequential action ..

Someone asked me why I only called the second one in Spawn? The Code is as follows:

// CCAnimation * animation1 = CCAnimation: createWithSpriteFrames (animFrames, 0.10f );
// CCAnimation * animation2 = CCAnimation: createWithSpriteFrames (animFrames1, 0.10f );
// CCSpawn * spawn = CCSpawn: create (CCFiniteTimeAction *) animation1, (CCFiniteTimeAction *) animation2/* can only play this one */, NULL );
// Sprite-> stopAllActions ();
// Sprite-> runAction (spawn );

Not Spawn cannot call two actions at the same time. The problem is that both actions are sequential frame animations.

The sequence frame animation updates the texture display of the genie according to the set time frequency, and the same Genie cannot display two textures. (The above code is not the first one not called, but overwritten)

What is Spawn used in?

For example, a role moves, one of which is an animation and one MoveTo action. The two actions can be implemented using Spawn.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.