Set of tools for drawing pie dial graphics

Available since

5.9.0

.

Static methods

@:value({ color : FlxColor.WHITE })staticdrawCircle(bitmap:BitmapData, ?radius:Float, color:FlxColor = FlxColor.WHITE, ?lineStyle:Null<LineStyle>, ?drawStyle:Null<DrawStyle>):BitmapData

This function draws a circle on a FlxSprite at position X,Y with the specified color.

Parameters:

bitmap

The BitmapData to manipulate

X

X coordinate of the circle's center (automatically centered on the sprite if -1)

Y

Y coordinate of the circle's center (automatically centered on the sprite if -1)

radius

Radius of the circle (makes sure the circle fully fits on the sprite's graphic if < 1, assuming and and y are centered)

color

The ARGB color to fill this circle with. FlxColor.TRANSPARENT (0x0) means no fill.

lineStyle

A LineStyle typedef containing the params of Graphics.lineStyle()

drawStyle

A DrawStyle typedef containing the params of BitmapData.draw()

Returns:

The FlxSprite for chaining

@:value({ fillColor : FlxColor.WHITE })staticdrawPolygon(bitmap:BitmapData, vertices:Array<FlxPoint>, fillColor:FlxColor = FlxColor.WHITE, ?lineStyle:Null<LineStyle>, ?drawStyle:Null<DrawStyle>):BitmapData

This function draws a polygon on a FlxSprite.

Parameters:

graphic

The FlxSprite to manipulate

Vertices

Array of Vertices to use for drawing the polygon

FillColor

The ARGB color to fill this polygon with. FlxColor.TRANSPARENT (0x0) means no fill.

lineStyle

A LineStyle typedef containing the params of Graphics.lineStyle()

drawStyle

A DrawStyle typedef containing the params of BitmapData.draw()

Returns:

The FlxSprite for chaining

@:value({ innerRadius : 0 })staticinlinedrawShape(dest:BitmapData, radius:Int, color:FlxColor, shape:FlxPieDialShape, innerRadius:Int = 0):BitmapData

Draws the specified shape onto the bitmap

Parameters:

dest

The bitmap to draw to

radius

The radius of the shape

color

The color of the shape

shape

The shape, Either SQUARE or CIRCLE

innerRadius

The radius of the inner hollow portion, where 0 means completely filled

@:value({ color : FlxColor.WHITE })staticdrawSweep(dest:BitmapData, degrees:Float, color:FlxColor = FlxColor.WHITE):Void

Draws a wedge section of a bitmap, used in FlxPieDial

Parameters:

dest

The btimap to draw to

degrees

The angle of the wedge

color

The color to fill the wedge

staticgetPieDialGraphic(radius:Int, color:FlxColor, frames:Int, shape:FlxPieDialShape, clockwise:Bool, innerRadius:Int):FlxGraphic

@:value({ color : FlxColor.WHITE, innerRadius : 0 })staticgetRadialGaugeGraphic(shape:FlxPieDialShape, radius:Int, innerRadius:Int = 0, color:FlxColor = FlxColor.WHITE):FlxGraphic

@:value({ color : FlxColor.WHITE, clockwise : true })staticrenderPieDial(shape:FlxPieDialShape, radius:Int, innerRadius:Int, frames:Int, clockwise:Bool = true, color:FlxColor = FlxColor.WHITE):BitmapData

Draws an animated pie dial graphic where each frame shows a more full amount, however the full gauge frame is on frame 0

Parameters:

radius

The radius of the shape

color

The color of the shape

frames
shape

The shape, Either SQUARE or CIRCLE

clockwise

The direction the gauge

innerRadius

The radius of the inner hollow portion, where 0 means completely filled

@:value({ color : FlxColor.WHITE, innerRadius : 0 })staticrenderRadialGauge(shape:FlxPieDialShape, radius:Int, innerRadius:Int = 0, color:FlxColor = FlxColor.WHITE):BitmapData

Draws an animated pie dial graphic where each frame shows a more full amount, however the full gauge frame is on frame 0

Parameters:

radius

The radius of the shape

color

The color of the shape

shape

The shape, Either SQUARE or CIRCLE

innerRadius

The radius of the inner hollow portion, where 0 means completely filled