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

    • CommentAuthorericsoco
    • CommentTimeOct 16th 2009
     
    is there functionality that allows for limiting the number of particles per emitter that can be alive at a given time? so if there are N particles alive, the emitter will essentially drop to using a ZeroCounter until there are less than N particles (i.e. some particles die).

    thanks,
    -e
    • CommentAuthorRichard
    • CommentTimeOct 19th 2009
     
    No, there's no such counter. It shouldn't be hard to do - you could extend any counter like this

    class LimitedSteady extends Steady
    {
    private var _limit:uint;

    public function LimitedSteady( limit:uint, rate:Number = 0 )
    {
    super( rate );
    _limit = limit;
    }

    override public function updateEmitter( emitter:Emitter, time:Number ):uint
    {
    if( emitter.particles.length >= _limit )
    {
    return 0;
    }
    var count:uint = super.updateEmitter( emitter, time );
    if( particles.length + count > _limit )
    {
    return _limit - particles.length;
    }
    return count;
    }
    }