Skip to main content
Participating Frequently
September 7, 2010
Question

Text Outline Issue

  • September 7, 2010
  • 2 replies
  • 820 views

Hi, I want to create a text with outline i am able to do that but requiremment of the task change, now we require a outline text where outline of text and text show's gap (as displayed on the image).

At some extent i m able to do that with GradientGlowFilter, but i m not able to handle the thickness of outline and gap in between text and outline.

Can you please help me out for this....

New idea for creating outlined text is welcomed if that handle the distance(gap in between text and outline) and thickness of outline.

Thanks

This topic has been closed for replies.

2 replies

Participant
September 7, 2010

Create 3 Ns, 1 inner white, 1 middle black, 1 outer white. Manipulate width and height as desired.

Inspiring
September 7, 2010

I think your best bet is to utilize BitmapData and bitmap filters.


Participating Frequently
September 8, 2010

Hi may be this code is helpful to you.

var txt:TextField = new TextField();
this.addChild(txt);
txt.appendText('Lorem ipsum');
txt.autoSize = TextFieldAutoSize.LEFT;
txt.antiAliasType = flash.text.AntiAliasType.NORMAL;
txt.selectable = false;

var txtFormat:TextFormat = new TextFormat();
txtFormat.size = 72;
txtFormat.color=0xff0000
txtFormat.font = 'Helvetica';
txt.setTextFormat(txtFormat);
txt.defaultTextFormat = txtFormat;

var gradientGlow:GradientGlowFilter = new GradientGlowFilter();
gradientGlow.distance = 0;
gradientGlow.angle = 0;
var clr:uint=0x000000
gradientGlow.colors = [0xFFFFFF, clr, 0xFFFFFF];
gradientGlow.alphas = [0, 1,0];
gradientGlow.ratios = [0,25, 256];
gradientGlow.blurX = gradientGlow.blurY = 7;
gradientGlow.strength = 2;
gradientGlow.quality = BitmapFilterQuality.HIGH;
gradientGlow.type = BitmapFilterType.OUTER;

var mc:MovieClip=new MovieClip();
mc.addChild(txt);

var mc1:MovieClip = new MovieClip();
this.addChild(mc1);

var bmpData:BitmapData = new BitmapData(mc.width, mc.height, true, 0xff0000);
bmpData.draw(mc);
var bmp:Bitmap = new Bitmap(bmpData);
bmp.smoothing = true;
mc1.addChild(bmp);

var filterArray:Array = new Array();
filterArray.push(gradientGlow);
mc1.filters = filterArray;
mc1.x=100;