Simple Application of cocos2dx built-in Particles

Source: Internet
Author: User

Simple Application of cocos2dx built-in Particles

Cocos2dx has 11 built-in particles:

  Name Motion mode
Particle fireworks Fireworks particle effect Gravity
CCParticleFire Flame particle effect Gravity
CCParticleSun Sun particle effect Gravity
CCParticleGalaxy Galaxy particle effect Radius Mode
CCParticleFlower Flower particle effect Gravity
CCParticleMeteor Meteor particle effect Gravity
CCParticleSpiral Vortex particle effect Radius Mode
CCParticleExplosion Explosive particle effect Radius Mode
CCParticleSmoke Smoke particle effect Gravity
CCParticleSnow Snow particle effect Gravity
CCParticleRain Rain particle effect Gravity Mode

 

Gravity Mode Particle attribute settings:

CCParticleSystem: setTangentialAccel (float t) ---- tangent acceleration of Particles

CCParticleSystem: setTangentialAccelVar (float t)-number of differences in the tangent acceleration of particles.

CCParticleSystem: setRadialAccel (float t) ---- Radial Acceleration of particles.

CCParticleSystem: setRadialAccelVar (float t)-number of differences in the Radial Acceleration of particles.

CCParticleSystem: setGravity (const CCPoint & g) ---- gravity of the Particle System

CCParticleSystem: setSpeed (float speed) ---- speed of particle emission

CCParticleSystem: setSpeedVar (float speedVar) ---- number of variations in speed

Radius Mode Particle attribute settings

CCParticleSystem: setStartRadius (float startRadius) ---- radius at particle start
CCParticleSystem: setStartRadiusVar (float startRadiusVar) ---- radius variation at particle start
CCParticleSystem: setEndRadius (float endRadius) ---- radius of the particle end
CCParticleSystem: setEndRadiusVar (float endRadiusVar) ---- Number of radius variations of particles at the end
CCParticleSystem: setRotatePerSecond (float degrees) ---- number of degrees in which particles rotate per second around the origin
CCParticleSystem: setRotatePerSecondVar (float degrees) ---- number of variations in the degree

 

Public attributes:

CCParticleSystem: setDuration (float var) ---- duration
CCParticleSystem: setSourcePosition (const CCPoint & var)
CCParticleSystem: setPosVar (const CCPoint & var)
CCParticleSystem: setLife (float var)
CCParticleSystem: setLifeVar (float var)
CCParticleSystem: setAngle (float var)
CCParticleSystem: setAngleVar (float var)
CCParticleSystem: setStartSize (float var)
CCParticleSystem: setStartSizeVar (float var)
CCParticleSystem: setEndSize (float var)
CCParticleSystem: setEndSizeVar (float var)
CCParticleSystem: setStartColor (const ccColor4F & var)
CCParticleSystem: setStartColorVar (const ccColor4F & var)
CCParticleSystem: setEndColor (const ccColor4F & var)
CCParticleSystem: setEndColorVar (const ccColor4F & var)
CCParticleSystem: setStartSpin (float var)
CCParticleSystem: setStartSpinVar (float var)
CCParticleSystem: setEndSpin (float var)
CCParticleSystem: setEndSpinVar (float var)
CCParticleSystem: setEmissionRate (float var)
CCParticleSystem: settotalparticipant (unsigned int var)

CCParticleSystem: setBlendFunc (ccBlendFunc blendFunc)
CCParticleSystem: setOpacityModifyRGB (bool bOpacityModifyRGB)
CCParticleSystem: setTimeScale (float timeScale)
CCParticleSystem: setPositionType (tCCPositionType var)
CCParticleSystem: setAutoRemoveOnFinish (bool var)
CCParticleSystem: setEmitterMode (int var)


// Particle System-methods for batchNode rendering
CCParticleSystem: setBatchNode (CCParticleBatchNode * batchNode)
CCParticleSystem: setScale (float s)
CCParticleSystem: setRotation (float newRotation)
CCParticleSystem: setScaleX (float newScaleX)
CCParticleSystem: setScaleY (float newScaleY)

 

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.