Hi,
im working on an Android game and i want some particle effects in front of the camera.
Each time the user is wiping above the screen, some effects should follow his fingers.
Ive
tried to attach it on the guiNode but I dont get it work (the particles didnt appear)
tried to attach an Node to the cameraNode ( thats complicated because of the diffrent screen widths)
@coolies said:
Hmm i dont get it 8-O
how can i switch to pixel size ?
Ive tried that code
[java]
guiNode.detachAllChildren();
ParticleEmitter fire =
new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 30);
Material mat_red = new Material(assetManager,
"Common/MatDefs/Misc/Particle.j3md");
mat_red.setTexture("Texture", assetManager.loadTexture(
"Effects/Explosion/flame.png"));
fire.setMaterial(mat_red);
fire.setImagesX(2);
fire.setImagesY(2); // 2x2 texture animation
fire.setEndColor(new ColorRGBA(1f, 0f, 0f, 1f)); // red
fire.setStartColor(new ColorRGBA(1f, 1f, 0f, 0.5f)); // yellow
fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 2, 0));
fire.setStartSize(1.5f); //<= start with 1, 5 pixel
fire.setEndSize(10f); // <= end with 10 pixel => really small in gui node...you may have 1920 pixels ^^
fire.setGravity(0, 1, 0);
fire.setLowLife(1f);
fire.setHighLife(3f);
fire.setLocalTranslation(settings.getWidth() / 2, settings.getHeight() / 2, 0); // be carefull in gui node 0,0 is at the bottom left corner
fire.getParticleInfluencer().setVelocityVariation(0.3f);
fire.setLocalScale(20);// i think you should remove it
AmbientLight al = new AmbientLight();
al.setColor(ColorRGBA.White.mult(1.3f));
guiNode.addLight(al); // no needs to add lights in the gui node, plus particle material doesn't handle lightning ^^
guiNode.attachChild(fire);