Flint Particle System Forum - dynamic "logo firework" 2011-12-13T06:11:11+00:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher dynamic "logo firework" http://flintparticles.org/forum/comments.php?DiscussionID=345&Focus=1174#Comment_1174 2010-04-17T14:08:18+01:00 2011-12-13T06:11:11+00:00 neonblue http://flintparticles.org/forum/account.php?u=351 I've been playing with http://flintparticles.org/examples/logo-firework on this site. Is there a way to do this effect with just plain text without using a bitmap? For example, I'd like to pass ...
Is there a way to do this effect with just plain text without using a bitmap? For example, I'd like to pass in a word or phrase and have this effect played on it.

Thanks.]]>
dynamic "logo firework" http://flintparticles.org/forum/comments.php?DiscussionID=345&Focus=1178#Comment_1178 2010-04-17T14:54:06+01:00 2011-12-13T06:11:11+00:00 Richard http://flintparticles.org/forum/account.php?u=1 If you use a DisplayObjectZone in the Velocity initializer, using a TextField as the display object, it should work. DisplayObjectZone in the Velocity initializer, using a TextField as the display object, it should work.]]> dynamic "logo firework" http://flintparticles.org/forum/comments.php?DiscussionID=345&Focus=1183#Comment_1183 2010-04-19T01:03:41+01:00 2011-12-13T06:11:11+00:00 neonblue http://flintparticles.org/forum/account.php?u=351 I did it this way... Is there an easier way? Also the word is not really that legible.. Is there a way I can sharpen the text?
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" width="400" height="300"
creationComplete="init()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import flash.filters.BlurFilter;
import flash.filters.ColorMatrixFilter;
import flash.geom.Point;
import flash.text.TextField;

import mx.core.UIComponent;
import mx.logging.Log;

import org.flintparticles.common.actions.Age;
import org.flintparticles.common.actions.Fade;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.displayObjects.RadialDot;
import org.flintparticles.common.energyEasing.Quadratic;
import org.flintparticles.common.events.EmitterEvent;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.emitters.Emitter2D;
import org.flintparticles.twoD.initializers.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.zones.*;

private var emitter:Emitter2D = new Emitter2D();
private var tfldTextString:TextField = new TextField();
private var tfFormat:TextFormat = new TextFormat();
[Bindable] private var bmGraphicString:BitmapData = new BitmapData(300,200,true,0x00FFFFFF);

private function init():void
{
var cnvs:UIComponent = new UIComponent();
emitter.counter = new Blast( 6000 );

CreateWord("H o o r a y !!");

emitter.addInitializer( new ColorInit( 0xFFFF3300, 0xFFFFFF00 ) );
emitter.addInitializer( new Lifetime( 6 ) );
emitter.addInitializer( new Position( new DiscZone( new Point( 0, 0 ), 10 ) ) );

emitter.addInitializer( new Velocity( new BitmapDataZone( bmGraphicString, -132, -300 ) ) );

emitter.addAction( new Age( Quadratic.easeIn ));
emitter.addAction( new Fade( 1.0, 0 ) );
emitter.addAction( new Move() );
emitter.addAction( new LinearDrag( 0.5 ) );
emitter.addAction( new Accelerate( 0, 70 ) );

emitter.addEventListener( EmitterEvent.EMITTER_EMPTY, restart );

var renderer:PixelRenderer = new PixelRenderer( new Rectangle( 0, 0, 500, 300 ) );
renderer.addFilter( new BlurFilter( 2, 2, 1 ) );
renderer.addFilter( new ColorMatrixFilter( [ 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0.96,0 ] ) );
renderer.addEmitter( emitter );

this.addElement( cnvs );
cnvs.addChild( renderer );

renderer.addEmitter( emitter );
emitter.x = 250;
emitter.y = 300;
emitter.start( );
}

private function CreateWord( szString:String ): void
{

tfldTextString.autoSize = TextFieldAutoSize.LEFT;
tfFormat.bold = true;
tfFormat.size = 60;
tfFormat.color = 0x000000;
tfldTextString.defaultTextFormat = tfFormat;
tfldTextString.text = szString;
tfldTextString.x = 150 - tfldTextString.width/2;
tfldTextString.y = 20;
bmGraphicString.draw(tfldTextString, tfldTextString.transform.matrix);
}

private function restart( ev:EmitterEvent ):void
{
Emitter2D( ev.target ).start();
}



]]>
</fx:Script>

</mx:Module>]]>
dynamic "logo firework" http://flintparticles.org/forum/comments.php?DiscussionID=345&Focus=1186#Comment_1186 2010-04-20T18:30:16+01:00 2010-04-20T18:31:37+01:00 Richard http://flintparticles.org/forum/account.php?u=1 To remove the blur, use a PointZone for the Position initializer emitter.addInitializer( new Position( new PointZone( new Point( 0, 0 ) ) ) ); Or remove it altogether (placing new particles at ...
emitter.addInitializer( new Position( new PointZone( new Point( 0, 0 ) ) ) );

Or remove it altogether (placing new particles at 0,0 is the default position behaviour).]]>