Flint Particle System Forum - Trouble fading rectangleParticles on DisplayObjectRenderer Tue, 13 Dec 2011 07:51:46 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Trouble fading rectangleParticles on DisplayObjectRenderer http://flintparticles.org/forum/comments.php?DiscussionID=355&Focus=1197#Comment_1197 http://flintparticles.org/forum/comments.php?DiscussionID=355&Focus=1197#Comment_1197 Wed, 12 May 2010 10:45:42 +0100 jmp909
I'm trying to explode a bitmap, with a fade on the particles. With my code below if i uncomment the Age and the Fade my particles don't show at all. What I want to do is have the particles begin to fade out as they reach a certain radius from the explosion centre.

Separately to this instead of using actual chunks of the bitmap I'd like to use, for example, 3x3 square particles that use getPixel on the image to get various colours from the image, and also add a blur/glow to that particle. (like this which currently doesn't use Flint.. http://www.brahm.com/download/test/box2d/test1/)

Any help on both of these would be much appreciated

regards
J

---

public function explode(actor:Actor)
{
renderer = new BitmapRenderer(new Rectangle( 0, 0, 320, 480 ) );
addChild( renderer );

var emitter:Emitter2D = new Emitter2D();
var BMPReference:Class = getDefinitionByName("FruitIcon1") as Class;
var bounds:Rectangle = actor.skin.getBounds(actor.skin.parent);
var bd:BitmapData = new BitmapData(bounds.width*actor.skin.scaleX, bounds.height*actor.skin.scaleY, true, 0x00000000);
var m:Matrix = actor.skin.transform.matrix.clone();
m.tx = -bounds.x*actor.skin.scaleX; m.ty = -bounds.y*actor.skin.scaleY;
bd.draw(actor.skin, m);
var bitmap:Bitmap = new Bitmap(bd, "auto", false);

var particles:Array = Particle2DUtils.createRectangleParticlesFromBitmapData( bitmap.bitmapData,8, emitter.particleFactory, obj.x-(actor.skin.width/2), obj.y-(actor.skin.height/2));
emitter.addExistingParticles( particles, false );

emitter.addAction( new Move() );
emitter.addAction( new Accelerate( 0, -25 ) );
emitter.addAction( new Explosion( 10, obj.x, obj.y, 200,10) );

//emitter.addAction(new Age());
//emitter.addAction(new Fade(1, 0.5));

emitter.start( );
emitter.addEventListener(EmitterEvent.EMITTER_EMPTY, onEmitterEmpty);
renderer.addEmitter(emitter);

} ]]>
Trouble fading rectangleParticles on DisplayObjectRenderer http://flintparticles.org/forum/comments.php?DiscussionID=355&Focus=1210#Comment_1210 http://flintparticles.org/forum/comments.php?DiscussionID=355&Focus=1210#Comment_1210 Wed, 19 May 2010 07:46:27 +0100 Richard
For the blurred particle, you probably want a variant on the createRectangleParticlesFromBitmapData() method. You could just add a blur filter when creating the particles, or maybe something else. ]]>