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

    • CommentAuthorbestam
    • CommentTimeApr 3rd 2012
     
    Hi people,

    First post! Glad to be using FLiNT, looks to be the best flash particle engine out there. Exactly what I needed for my project, I will credit your work Richard.

    However I'm having issues with larger particles. I'm emitting large smoke particles and smaller ones from the same point. As the particles aren't centered, I come up with this result :
    http://www.itstudents.be/~abrakam/faeriawp/particles.png
    I would like the big smoke to be occupying the same space as the smaller sparks... Is there a way to tell the emitter to center them all? Here is all I do to define their initial position :
    locBigSmokeEmiter.addInitializer( new Position( new DiscZone( new Point( 0, 0 ), 30)));

    Thx!
    • CommentAuthorbestam
    • CommentTimeApr 3rd 2012
     
    Useful to know, here I declare all my particles with an ImageClass (dunno if there's something else) :
    locBigSmokeEmiter.addInitializer( new ImageClass( Assets.SMOKE ) );
    • CommentAuthorRichard
    • CommentTimeApr 19th 2012
     
    The particles are positioned relative to their registration point. If you define the smoke asset with its registration point in the centre, it should be fine.
    • CommentAuthorbestam
    • CommentTimeMay 7th 2012
     
    OK I found a solution. Just sharing :

    new ImageClass( Particle, [Assets.ENERGY] )

    public class Particle extends Sprite {
    public function Particle(parImageClass:Class) {
    const locBitmap:Bitmap = new parImageClass();
    locBitmap.x = -locBitmap.width/2;
    locBitmap.y = -locBitmap.height/2;
    addChild(locBitmap);
    }
    }
    }