I'm bored.. working on a new project so might as well do other stuff while I'm at it.
This example will be using Skilly's [Educational Source], as I'm assuming it's the new HOT source... and also happens to be the source that I'm testing/working with. It shouldn't really matter what source you use as this more of a as3 basics tutorial.
Navigate to: TitleMenuOption.as and remove the dropShadow filter from the textField. (You could do this more dynamically and remove it when the outline is being done, but I find the dropShadow filter to be kind of shit so just remove it)
Code:
public function setText(text:String) : void
{
name = text;
if(this.textField)
{
removeChild(this.textField);
}
this.textField = new SimpleText(this.size,txtClr,false,0,0);
this.textField.setBold(bold);
this.textField.text = text;
this.textField.updateMetrics();
addChild(this.textField);
}
now add these functions:
Code:
public function addOutline(thickness:int = 1, clr:uint = 0):void {
var filter:GlowFilter = new GlowFilter(clr, 1, thickness, thickness, thickness * 10, BitmapFilterQuality.HIGH);
filters = [filter];
}
public function removeOutline():void {
filters = [];
}
addOutline adds an outline to the text button and removeOutline does the opposite.
NOTE: You could implement this directly into the textField and overwrite it in TitleMenuOption.as for a much better, multi-purpose use. But keep in mind that things like color transform will overwrite any filters that you add to an DisplayObject ( hence why in this example I just put in TitleMenuOption.as ) depending on the way you apply the filter that is.
Should look something like this: