Flint Particle System Forum - Centering particles2012-05-26T07:30:43+01:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Centering particleshttp://flintparticles.org/forum/comments.php?DiscussionID=557&Focus=1901#Comment_19012012-04-03T13:05:12+01:002012-05-26T07:30:43+01:00bestamhttp://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 particleshttp://flintparticles.org/forum/comments.php?DiscussionID=557&Focus=1902#Comment_19022012-04-03T13:14:27+01:002012-05-26T07:30:43+01:00bestamhttp://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 particleshttp://flintparticles.org/forum/comments.php?DiscussionID=557&Focus=1913#Comment_19132012-04-19T22:47:05+01:002012-05-26T07:30:43+01:00Richardhttp://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 particleshttp://flintparticles.org/forum/comments.php?DiscussionID=557&Focus=1925#Comment_19252012-05-07T14:23:25+01:002012-05-26T07:30:43+01:00bestamhttp://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); } } }]]>