Flint Particle System Forum - Centering particles 2012-05-26T07:30:43+01:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher Centering particles http://flintparticles.org/forum/comments.php?DiscussionID=557&Focus=1901#Comment_1901 2012-04-03T13:05:12+01:00 2012-05-26T07:30:43+01:00 bestam http://flintparticles.org/forum/account.php?u=603 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 ...
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!]]>
Centering particles http://flintparticles.org/forum/comments.php?DiscussionID=557&Focus=1902#Comment_1902 2012-04-03T13:14:27+01:00 2012-05-26T07:30:43+01:00 bestam http://flintparticles.org/forum/account.php?u=603 Useful to know, here I declare all my particles with an ImageClass (dunno if there's something else) : locBigSmokeEmiter.addInitializer( new ImageClass( Assets.SMOKE ) ); locBigSmokeEmiter.addInitializer( new ImageClass( Assets.SMOKE ) );]]> Centering particles http://flintparticles.org/forum/comments.php?DiscussionID=557&Focus=1913#Comment_1913 2012-04-19T22:47:05+01:00 2012-05-26T07:30:43+01:00 Richard http://flintparticles.org/forum/account.php?u=1 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. Centering particles http://flintparticles.org/forum/comments.php?DiscussionID=557&Focus=1925#Comment_1925 2012-05-07T14:23:25+01:00 2012-05-26T07:30:43+01:00 bestam http://flintparticles.org/forum/account.php?u=603 OK I found a solution. Just sharing : new ImageClass( Particle, [Assets.ENERGY] ) public class Particle extends Sprite { public function Particle(parImageClass:Class) { const ...
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);
}
}
}]]>