Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthorchien
    • CommentTimeFeb 4th 2009
     
    I think this is something staring me in the face but I am not seeing it.

    I am trying to dissolve an image from left to right and have tried many approaches. It works well as doing the whole image or part of the image but I can't seem to get it to work slowly going across the image.

    current code fragment is below.

    Any help would be appreciated.

    Thanks

    chien

    import org.flintparticles.twoD.actions.*;
    import org.flintparticles.twoD.activities.*;
    import org.flintparticles.twoD.emitters.Emitter2D;
    import org.flintparticles.twoD.particles.Particle2DUtils;
    import org.flintparticles.twoD.renderers.*;
    //import org.flintparticles.twoD.zones.RectangleZone;
    import org.flintparticles.twoD.initializers.*;
    import org.flintparticles.common.initializers.*;
    import org.flintparticles.twoD.zones.*;

    var emitter:Emitter2D = new Emitter2D();
    var particles:Array = Particle2DUtils.createPixelParticlesFromBitmapData( new Image2(384,255), emitter.particleFactory, 50, 75);
    emitter.addExistingParticles( particles, false );

    var renderer:PixelRenderer = new PixelRenderer(new Rectangle( 0, 0, 500, 255 ));
    renderer.addEmitter( emitter );
    addChild( renderer );
    emitter.start();


    emitter.addAction (new ZonedAction(new Accelerate( 0, 5), new RectangleZone( 0, 0, 200, 400), false ));
    emitter.addAction (new ZonedAction(new RandomDrift( 10, 40 ), new RectangleZone( 0, 0, 200, 400), false ));
    //emitter.addActivity ( new MoveEmitter (100,0));
    //emitter.addAction (new Accelerate( 0, 5));
    //emitter.addAction( new RandomDrift( 10, 40 ) );
    emitter.addAction( new Move() );
    emitter.addAction( new DeathZone( new RectangleZone( 0, 0, 500, 255 ), true ) );
    • CommentAuthorchien
    • CommentTimeFeb 4th 2009
     
    Actually I just took a fresh look at this and it looks like a custom emitter that uses the set property of the rectangle zone may work. I'll try this the next opportunity I get and see it if works unless someone else mentions otherwise.

    chien
    • CommentAuthorchien
    • CommentTimeFeb 5th 2009
     
    Just for reference, if anyone else is trying this. My theory worked without requiring any customization of anything. This one little modification saved a HUGE amount of overhead (10s of megabytes) by not having to achieve the same effect in AE and importing the result into Flash.

    chien
    • CommentAuthorRichard
    • CommentTimeFeb 9th 2009 edited
     
    Hi chien. Sorry I wasn't around to help but I'm glad you worked it out. Nice solution.