Static variables

staticread onlystyle:Context2DStyle

Static methods

staticinlinebegin(this:Graphics):Void

staticinlineclear(this:Graphics, color:Color):Void

staticinlinedrawAlignedCharacters(this:Graphics, text:Array<Int>, start:Int, length:Int, x:Float, y:Float, alignment:Alignment):Void

staticinlinedrawAlignedString(this:Graphics, text:String, x:Float, y:Float, alignment:Alignment):Void

@:value({ segments : 0, ccw : false, strength : 1 })staticinlinedrawArc(this:Graphics, cx:Float, cy:Float, radius:Float, sAngle:Float, eAngle:Float, strength:Float = 1, ccw:Bool = false, segments:Int = 0):Void

Draws a arc.

Parameters:

ccw

(optional) Specifies whether the drawing should be counterclockwise.

segments

(optional) The amount of lines that should be used to render the arc.

@:value({ segments : 0, strength : 1 })staticinlinedrawCircle(this:Graphics, cx:Float, cy:Float, radius:Float, strength:Float = 1, segments:Int = 0):Void

Draws a circle.

Parameters:

segments

(optional) The amount of lines that should be used to render the circle.

@:value({ strength : 1.0, segments : 20 })staticinlinedrawCubicBezier(this:Graphics, x:Array<Float>, y:Array<Float>, segments:Int = 20, strength:Float = 1.0):Void

Draws a cubic bezier using 4 pairs of points. If the x and y arrays have a length bigger then 4, the additional points will be ignored. With a length smaller of 4 a error will occur, there is no check for this. You can construct the curves visually in Inkscape with a path using default nodes. Provide x and y in the following order: startPoint, controlPoint1, controlPoint2, endPoint Reference: http://devmag.org.za/2011/04/05/bzier-curves-a-tutorial/

@:value({ strength : 1.0, segments : 20 })staticinlinedrawCubicBezierPath(this:Graphics, x:Array<Float>, y:Array<Float>, segments:Int = 20, strength:Float = 1.0):Void

Draws multiple cubic beziers joined by the end point. The minimum size is 4 pairs of points (a single curve).

staticinlinedrawImage(this:Graphics, img:Image, x:Float, y:Float):Void

@:value({ strength : 1 })staticinlinedrawPolygon(this:Graphics, x:Float, y:Float, vertices:Array<Vec2>, strength:Float = 1):Void

Draws a convex polygon.

@:value({ strength : 1.0, segments : 20 })staticinlinedrawQuadraticBezier(this:Graphics, x:Array<Float>, y:Array<Float>, segments:Int = 20, strength:Float = 1.0):Void

Draws a quadratic bezier using 3 pairs of points. Provide x and y in the following order: startPoint, controlPoint, endPoint

@:value({ strength : 1.0, segments : 20 })staticinlinedrawQuadraticBezierPath(this:Graphics, x:Array<Float>, y:Array<Float>, segments:Int = 20, strength:Float = 1.0):Void

Draws multiple quadratic beziers joined by the end point. The minimum size is 3 pairs of points (a single curve).

staticinlinedrawScaledImage(this:Graphics, img:Image, dx:Float, dy:Float, dw:Float, dh:Float):Void

dx, dy, dw, dh arguments is the rectangle to draw into the destination context

staticinlinedrawScaledSubImage(this:Graphics, img:Image, sx:Float, sy:Float, sw:Float, sh:Float, dx:Float, dy:Float, dw:Float, dh:Float):Void

sx, sy, sw, sh arguments is the sub-rectangle of the source img image dx, dy, dw, dh arguments is the rectangle to draw into the destination context

staticinlinedrawSubImage(this:Graphics, img:Image, x:Float, y:Float, sx:Float, sy:Float, sw:Float, sh:Float):Void

sx, sy, sw, sh arguments is the sub-rectangle of the source img image

@:value({ segments : 0, ccw : false })staticinlinefillArc(this:Graphics, cx:Float, cy:Float, radius:Float, sAngle:Float, eAngle:Float, ccw:Bool = false, segments:Int = 0):Void

Draws a filled arc.

Parameters:

ccw

(optional) Specifies whether the drawing should be counterclockwise.

segments

(optional) The amount of lines that should be used to render the arc.

@:value({ segments : 0 })staticinlinefillCircle(this:Graphics, cx:Float, cy:Float, radius:Float, segments:Int = 0):Void

Draws a filled circle.

Parameters:

segments

(optional) The amount of lines that should be used to render the circle.

staticinlinefillPolygon(this:Graphics, x:Float, y:Float, vertices:Array<Vec2>):Void

Draws a filled convex polygon.

staticinlinepopTransformation(this:Graphics):Mat3

staticinlinepushTransformation(this:Graphics, value:Mat3):Void

@:value({ clearColor : Transparent })staticinlinerender(this:Graphics, ?clear:Bool, clearColor:Color = Transparent, commands:Context2D ‑> Void):Void