Flint Particle System Forum - Animate particles to a bitmap shape2010-12-26T18:40:17+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Animate particles to a bitmap shapehttp://flintparticles.org/forum/comments.php?DiscussionID=102&Focus=436#Comment_4362008-10-15T14:11:08+01:002008-10-30T14:58:47+00:00timhttp://flintparticles.org/forum/account.php?u=78
Just started playing with Flint (great work Richard).
Anyone have any ideas of how I could set particles to be a bitmap shape periodically?
So they start as a shape:
emitter.addInitializer( ...
Anyone have any ideas of how I could set particles to be a bitmap shape periodically?
So they start as a shape: emitter.addInitializer( new Position( new BitmapDataZone(bitmap.bitmapData)));
Then I animate them by using an Action.
On a mouse click I'd like them to resume their initial positions.
One thing I considered was grabbing their positions from the BitmapDataZone and using TargetVelocity action, but this goes against the Flint architecture.
Thanks, tim]]>
Animate particles to a bitmap shapehttp://flintparticles.org/forum/comments.php?DiscussionID=102&Focus=438#Comment_4382008-10-15T17:56:47+01:002008-10-15T17:56:52+01:00Richardhttp://flintparticles.org/forum/account.php?u=1
Do you want them to return to the exact same position, or to any position inside the bitmap?
For the same position, you'll need to create a custom initializer based on the Position initializer, ...
For the same position, you'll need to create a custom initializer based on the Position initializer, that stores the start position in the particle - add
particle.dictionary["startPosition"] = new Point( particle.x, particle.y );
at the end of the initialize method, or something similar.
For a different position in the bitmap, use
var position:Point = zone.getLocation();
where zone is your BitmapDataZone.
To approach the point, you probably want a custom action, which may be similar to TurnTowardsPoint or may be some sort of timed tween. In either case, it will use the point obtained above as the target point for the action.
Add the action to your emitter to make all the points approach their target, and remove it to make it stop. Or have stop/start methods on the action to turn it on and off.]]>
Animate particles to a bitmap shapehttp://flintparticles.org/forum/comments.php?DiscussionID=102&Focus=852#Comment_8522009-07-10T15:52:03+01:002009-07-10T16:21:48+01:00ezrahttp://flintparticles.org/forum/account.php?u=220
I have reposted my question in a new threat as it was slightly unrealated.