She hasn't met each other for almost two or three years in high school. She came to Quanzhou in the afternoon and we had a meal together. Since my graduation from high school, we have lost a lot of contact with each other. We have seen two or three sides in college. Now that I have graduated for almost a year, she is a woman, and my own feelings are also the long-term stability and recent ups and downs. In fact, the feeling has never changed. What has changed is that people and things are constantly affected by the surrounding area. You must be happy, and I am striving for happiness.
-----
This article is about particles. In fact, I have no research on the particles, because at the beginning of cocos2dx, the general manager told me that the particles can be ignored for the moment, because it is not available yet. This also caused me to intentionally or unintentionally avoid the particle knowledge for a long time. So, I am also a cainiao. I still have a lot to understand. Although there are still many blogs, the level is still good. Some people call me a great god, hero or something. Please never "curse" me ~~~.Because the process from ignorance to understanding is painful and happy. Every time I learn a new knowledge point, I want to share it with my blog, on the one hand, I can deepen my understanding of this knowledge point. On the other hand, I also want to let more people know this knowledge point and avoid detours...
If you think I want to explain the principles of particles, it is a big mistake. After all, the tricky article isShort but can be rotated. I will pull out some ready-made particle effects that can be used directly. Start to pull:
1. First talk about special snowflake effects. I saw a game called tribe last winter, and its map interface was always filled with snow. At that time, I thought it was really TM's high-end atmosphere. Now I am happy.
Particle System * ps = particle snow: create (); // because of laziness, I directly use the close image in helloWorld as the snowflake ps-> setTexture (Director: getInstance () -> getTextureCache ()-> addImage ("CloseSelected.png"); ps-> setPosition (Point (200,200 )); // The generated snowflake falls from this coordinate. this-> addChild (ps, 10 );Demonstration results... imagine it yourself.
If you want to control the number of snowflakes in a scenario, you can use the following interface. The following examples are the same:
Static participant snow * createwithtotalparticipant (int numberofparticipant); // The parameter is the number of snowflakes.
2. Fireworks
ParticleSystem* ps = ParticleFireworks::create();ps->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseSelected.png"));ps->setPosition(Point(200,200));this->addChild(ps,10);3. Rain Effect
ParticleSystem* ps = ParticleRain::create();ps->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseSelected.png"));ps->setPosition(Point(200,200));this->addChild(ps,10);4. Smoke
Particle System * ps = MAID: create (); // The effect is really bad ps-> setTexture (Director: getInstance ()-> getTextureCache () -> addImage ("CloseSelected.png"); ps-> setPosition (Point (200,200); this-> addChild (ps, 10 );5. Explosion
ParticleSystem* ps = ParticleExplosion::create();ps->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseSelected.png"));ps->setPosition(Point(200,200));this->addChild(ps,10);6. Spiral
ParticleSystem* ps = ParticleSpiral::create();ps->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseSelected.png"));ps->setPosition(Point(200,200));this->addChild(ps,10);7. Meteor (it will be more appropriate to describe with a comet because it will drag a long tail)
ParticleSystem* ps = ParticleMeteor::create();ps->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseSelected.png"));ps->setPosition(Point(200,200));this->addChild(ps,10);8. nebula
ParticleSystem* ps = ParticleGalaxy::create();ps->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseSelected.png"));ps->setPosition(Point(200,200));this->addChild(ps,10);9. Sun (day)
ParticleSystem* ps = ParticleSun::create();ps->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseSelected.png"));ps->setPosition(Point(200,200));this->addChild(ps,10);10. Flame
ParticleSystem* ps = ParticleFire::create();ps->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseSelected.png"));ps->setPosition(Point(200,200));this->addChild(ps,10);
Haha, it's finished. I haven't written such a copy and paste blog for a long time. Hey.
Respect Original, reprinted please indicate Source: http://blog.csdn.net/star530/article/details/23552641