Package tripleplay.particle

Examples of tripleplay.particle.Emitter


    @Override protected void createParticles (Particles parts, final Randoms rando) {
        CanvasImage image = graphics().createImage(2, 2);
        image.canvas().setFillColor(0xFFFFFFFF);
        image.canvas().fillRect(0, 0, 2, 2);

        final Emitter explode1 = createEmitter(parts, rando, image, 0xFFFFCD82, 0.975f);
        final Emitter explode2 = createEmitter(parts, rando, image, 0xFFF06969, 0.95f);
        note(explode1);
        note(explode2);

        float tx = 100 + rando.getFloat(graphics().width()-200);
        float ty = 100 + rando.getFloat(graphics().height()-200);
View Full Code Here


        }});
    }

    protected Emitter createEmitter (Particles parts, Randoms rando, CanvasImage image,
                                     int color, float drag) {
        final Emitter explode = parts.createEmitter(200, image);
        explode.generator = Generator.impulse(200);
        explode.initters.add(Lifespan.random(rando, 1, 1.5f));
        explode.initters.add(Color.constant(color));
        // explode.initters.add(Color.constant(0xFFF06969));
        explode.initters.add(Transform.layer(explode.layer));
View Full Code Here

    @Override protected void createParticles (Particles parts, Randoms rando) {
        CanvasImage image = graphics().createImage(7, 7);
        image.canvas().setFillColor(0xFFFFFFFF);
        image.canvas().fillCircle(3, 3, 3);

        Emitter emitter = parts.createEmitter(5000, image);
        emitter.generator = Generator.constant(100);
        emitter.initters.add(Lifespan.constant(5));
        emitter.initters.add(Color.constant(0xFF99CCFF));
        emitter.initters.add(Transform.layer(emitter.layer));
        emitter.initters.add(Velocity.randomSquare(rando, -20, 20, -100, 0));
View Full Code Here

     *
     * @param image the image to use for each particle.
     * @param onLayer the layer to which to add the layer which will render the particles.
     */
    public Emitter createEmitter (int maxParticles, Image image, GroupLayer onLayer) {
        final Emitter emitter = new Emitter(this, maxParticles, image);
        emitter._conn = _onPaint.connect(new Slot<Now>() { @Override public void onEmit (Now now) {
            emitter.update(now.time, now.dt);
        }});
        onLayer.add(emitter.layer);
        return emitter;
    }
View Full Code Here

TOP

Related Classes of tripleplay.particle.Emitter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.