Flint Particle System Forum - Questions to createPixelParticlesFromBitmapData() Sun, 27 May 2012 07:06:52 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Questions to createPixelParticlesFromBitmapData() http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1313#Comment_1313 http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1313#Comment_1313 Tue, 31 Aug 2010 19:11:31 +0100 radykal
first of all a great compliment to Richard, amazing Particle Engine. So I played around with your Particle Engine and I would like to use it for some projects. But I have one questions:

How can I ignore transparent pixels. I convert a movieclip into a bitmapdata object and give this one to the paramter of a createPixelParticlesFromBitmapData() method. Now when the emitter starts, I see also black particles, although the movieclip has only 2 white lines. This is my code:


mc.visible = false;
var bmd:BitmapData = new BitmapData(mc.width, mc.height, true, 0x00000000);
bmd.draw(mc);

emitter = new Emitter2D();
renderer = new PixelRenderer(new Rectangle(0, 0, stage.stageWidth, stage.stageHeight));

particles = Particle2DUtils.createPixelParticlesFromBitmapData(bmd, emitter.particleFactory, bmHolder.x, bmHolder.y);

emitter.addInitializer(new Velocity(zone));
emitter.addInitializer(new Lifetime(0.5, 1));
emitter.addExistingParticles(particles, true);

emitter.addAction(new Age(Sine.easeOut));
emitter.addAction(new Move());
emitter.addAction(new RandomDrift(-600, -600));
emitter.addAction(new Fade(1, 0));
emitter.addAction(new SpeedLimit(200));


renderer.addFilter(new BlurFilter(2, 2, 1), false);
renderer.addEmitter(emitter);

addChild(renderer);


I notice that I only see the black particles in combination with the Fade action.

Thanks ]]>
Questions to createPixelParticlesFromBitmapData() http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1315#Comment_1315 http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1315#Comment_1315 Wed, 01 Sep 2010 08:32:19 +0100 Richard
This happens because createPixelParticlesFromBitmapData() copies all pixels, including the transparent ones. The Fade method then changes the alpha of the particles to create the fade, which reveals the transparent pixels.

I've added a couple of lines of code to the createPixelParticlesFromBitmapData() method to fix the problem (see line 124 here). This is committed to the GitHub repository and will be in the next full release.

Richard ]]>
Questions to createPixelParticlesFromBitmapData() http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1316#Comment_1316 http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1316#Comment_1316 Wed, 01 Sep 2010 22:36:32 +0100 radykal
I would like to use the subversion of git. I´m using svnX on Max, but it seems that´s not working. I already checked out any FAQ and tutorials but nothing works.

Is this the correct subersion path:
http://svn.github.com/richardlord/Flint.git ]]>
Questions to createPixelParticlesFromBitmapData() http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1319#Comment_1319 http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1319#Comment_1319 Thu, 02 Sep 2010 08:51:51 +0100 Richard
svn checkout http://svn.github.com/richardlord/Flint.git

I expect svnX is trying to browse the repository and show you what's in it. That unfortunately won't work.

More (but not much more) here - http://github.com/blog/626-announcing-svn-support. ]]>
Questions to createPixelParticlesFromBitmapData() http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1321#Comment_1321 http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1321#Comment_1321 Thu, 02 Sep 2010 23:09:52 +0100 radykal I try to rebuild an effect of this website:
http://powerflasher.de/

Move mouse over the yellow buttons. The developers of this site said already that they used your engine for this effect.

I was looking for an event which dispatch when moving the mouse over a particle and return the particle, but there is no one for it. You already implent a MouseAntiGravity action, but then the particles will not go back.
So I dont want the exact code, only some tipps that show me the direction to develop something like that. :)

Thanks ]]>
Questions to createPixelParticlesFromBitmapData() http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1325#Comment_1325 http://flintparticles.org/forum/comments.php?DiscussionID=390&Focus=1325#Comment_1325 Sun, 05 Sep 2010 10:37:39 +0100 Richard
The former may be possible by simply adding a distance limit to the MouseAnitGravity action, and the latter by treating the original position as a personal gravity well for the particle. In both cases you'd require a lot of damping to make the particles stop quickly when they reach the target position.

Ryan Hodson describes creating custom actions in his Flinteroids tutorial. ]]>