/** * Set the maximum amount of particles that * can exist at the same time with this emitter. * Calling this method many times is not recommended. * * @param numParticles the maximum amount of particles that * can exist at the same time with this emitter. */ public final void setNumParticles(int numParticles) { particles = new Particle[numParticles]; for (int i = 0; i < numParticles; i++) { particles[i] = new Particle(); } //We have to reinit the mesh's buffers with the new size particleMesh.initParticleData(this, particles.length); particleMesh.setImagesXY(this.imagesX, this.imagesY); firstUnUsed = 0; lastUsed = -1; }
/** * Set the maximum amount of particles that * can exist at the same time with this emitter. * Calling this method many times is not recommended. * * @param numParticles the maximum amount of particles that * can exist at the same time with this emitter. */ public final void setNumParticles(int numParticles) { particles = new Particle[numParticles]; for (int i = 0; i < numParticles; i++) { particles[i] = new Particle(); } //We have to reinit the mesh's buffers with the new size particleMesh.initParticleData(this, particles.length); particleMesh.setImagesXY(this.imagesX, this.imagesY); firstUnUsed = 0; lastUsed = -1; }
/** * Set the maximum amount of particles that * can exist at the same time with this emitter. * Calling this method many times is not recommended. * * @param numParticles the maximum amount of particles that * can exist at the same time with this emitter. */ public final void setNumParticles(int numParticles) { particles = new Particle[numParticles]; for (int i = 0; i < numParticles; i++) { particles[i] = new Particle(); } //We have to reinit the mesh's buffers with the new size particleMesh.initParticleData(this, particles.length); particleMesh.setImagesXY(this.imagesX, this.imagesY); firstUnUsed = 0; lastUsed = -1; }