我正在开发一个游戏项目,并且想知道将点击事件设置为打开,SpriteParticleSystem
因为我已将粒子数设置为 1。
如何使这个粒子可点击?
{
// B1= new ButtonSprite(8, 12, this.mParticleTextureRegion, this.getVertexBufferObjectManager());
final SpriteParticleSystem particleSystem1 = new SpriteParticleSystem(new PointParticleEmitter(GameActivity.CAMERA_WIDTH - 200, GameActivity.CAMERA_HEIGHT), 8, 12, 1, this.player, this.getVertexBufferObjectManager());
particleSystem1.addParticleInitializer(new VelocityParticleInitializer<Sprite>(-15, -22, -70, -90));
particleSystem1.addParticleInitializer(new AccelerationParticleInitializer<Sprite>(0, 15));
particleSystem1.addParticleInitializer(new RotationParticleInitializer<Sprite>(0.0f, 360.0f));
particleSystem1.addParticleInitializer(new ExpireParticleInitializer<Sprite>(11.5f));
particleSystem1.addParticleModifier(new AlphaParticleModifier<Sprite>(2.5f, 3.5f, 1.0f, 0.0f));
particleSystem1.addParticleModifier(new AlphaParticleModifier<Sprite>(3.5f, 4.5f, 0.0f, 1.0f));
particleSystem1.addParticleModifier(new AlphaParticleModifier<Sprite>(4.5f, 11.5f, 1.0f, 0.0f));
scene.attachChild(particleSystem1);
}
/* Left to right Particle System. */
{
particleSystem2 = new SpriteParticleSystem(new PointParticleEmitter(200, GameActivity.CAMERA_HEIGHT), 6, 30000, 1, this.mParticleTextureRegion, this.getVertexBufferObjectManager());
//particleSystem2.addParticleInitializer(new BlendFunctionParticleInitializer<Sprite>(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE));
particleSystem2.addParticleInitializer(new VelocityParticleInitializer<Sprite>(15, 22, -60, -90));
particleSystem2.addParticleInitializer(new AccelerationParticleInitializer<Sprite>(-1, 15));
particleSystem2.addParticleInitializer(new RotationParticleInitializer<Sprite>(0.0f, 360.0f));
//particleSystem2.addParticleInitializer(new ColorParticleInitializer<Sprite>(1.0f, 0.0f, 0.0f));
particleSystem2.addParticleInitializer(new ExpireParticleInitializer<Sprite>(11.5f));
//particleSystem.addParticleModifier(new ScaleParticleModifier<Sprite>(0, 5, 0.5f, 2.0f));
particleSystem2.addParticleModifier(new AlphaParticleModifier<Sprite>(2.5f, 3.5f, 1.0f, 0.0f));
particleSystem2.addParticleModifier(new AlphaParticleModifier<Sprite>(3.5f, 4.5f, 0.0f, 1.0f));
//particleSystem.addParticleModifier(new ColorParticleModifier<Sprite>(0.0f, 11.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f));
particleSystem2.addParticleModifier(new AlphaParticleModifier<Sprite>(4.5f, 11.5f, 1.0f, 0.0f));
scene.attachChild(particleSystem2);
}