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
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
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.
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).
2.1.0
.