|
/* initialize LinearParticle, this is the first thing you need to do before using LinearParticle. */ L_ParticleSystem::init(); // create surface CL_Surface surface("image.png"); surface.set_alignment(origin_center); // create a sample of particle with life of 5000 L_Particle particle(&surface,5000); // create dropping effect with dropping period of 16 L_DroppingEffect effect(0,0,16); // add the particle to dropper effect effect.add(&particle); // initialize particle effect effect.initialize(); |
|
CL_Display::clear(CL_Color(0,0,0)); // Call L_ParticleEffect::tirgger() to trigger emission of particles effect.trigger(); // set position of the dropping point effect.set_position(x_pos, y_pos); /* pass frame time to L_ParticleEffect::run(int) for time based system, a constant number would be a reference time unit for frame based system. */ effect.run(16); // draw dropping effect effect.draw(); CL_Display::flip(); CL_System::keep_alive(); |
|
// deinitialize LinearParticle L_ParticleSystem::deinit(); |
LinearParticle Documentation © 2006-2007 by Wong Chin Foo.