Today, a supplement to the Cocos2D-x fell last night very important section --------> particle system;
As a beginner, I used several basic classes in the example to combine the following scenarios:
<Strong? Http: www.bkjia.com kf ware vc "target =" _ blank "class =" keylink "> VcD4KPHA + PGJyPgo8L3A + CjxwPjxpbWcgc3JjPQ = "http://www.2cto.com/uploadfile/Collfiles/20140401/2014040109253927.jpg" alt = "\">
The Code is as follows:
CCParticleSystem * m_emitter = CCParticleExplosion: create (); m_emitter-> retain (); this-> addChild (m_emitter, 1); m_emitter-> setTexture (CCTextureCache: sharedTextureCache () -> addImage ("stars.png"); CCSize s = CCDirector: sharedDirector ()-> getWinSize (); if (m_emitter! = NULL) {CCSize spritesize = GetSprite ()-> getContentSize (); m_emitter-> setPosition (ccp (spritesize. width/2-30, spritesize. height/2-30 ));}