This creates an outline around the bitmapData. This is a modified version of FlxOutline by red__hara, with some code get from FlxText's borders.

Constructor

@:value({ Quality : 1, Threshold : 0, Thickness : 1, Color : FlxColor.WHITE })new(?Mode:FlxOutlineMode, Color:FlxColor = FlxColor.WHITE, Thickness:Int = 1, Threshold:Int = 0, Quality:Float = 1)

Creates an outline around the bitmapData with the specified color and thickness. To update, dirty need to be setted as true.

Parameters:

Mode

Which Mode you would like to use for the effect. FAST = Optimized using only 4 draw calls, NORMAL = Outline on all 8 sides, PIXEL_BY_PIXEL = Surround every pixel (can affect performance).

Color

Color of the outline.

Thickness

Outline thickness in pixels.

Threshold

Alpha sensitivity, only used with PIXEL_BY_PIXEL mode.

Quality

Outline quality - # of iterations to use when drawing. 0:just 1, 1:equal number to Thickness. Not used with PIXEL_BY_PIXEL mode.

Variables

@:value(true)active:Bool = true

color:FlxColor

Color of the outline.

@:value(true)dirty:Bool = true

Set this flag to true to force the effect to update during the apply() call. This effect is too heavy, and must be called just when the main shape of sprite changes.

mode:FlxOutlineMode

Which mode we're using for the effect

Available since

2.1.0

.

@:value(FlxPoint.get())read onlyoffset:FlxPoint = FlxPoint.get()

quality:Float

How many iterations do use when drawing the outline. 0: only 1 iteration, 1: one iteration for every pixel in thickness A value of 1 will have the best quality for large border sizes, but might reduce performance. NOTE: If the thickness is 1, quality of 0 or 1 will have the exact same effect (and performance).

Available since

2.1.0

.

thickness:Int

Stroke thickness in pixels of outline.

threshold:Int

Set alpha sensitivity to a number between 0 and 1.

Methods