Static extension functions for Graphics2. Usage: "using kha.graphics2.GraphicsExtension;"

Static methods

staticdrawCircle (g2:Graphics, cx:Float, cy:Float, radius:Float, ?strength:Float, ?segments:Int):Void

Draws a circle.

Parameters:

segments

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

staticdrawCubicBezier (g2:Graphics, x:Array<Float>, y:Array<Float>, ?segments:Int, ?strength:Float):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. Reference: http://devmag.org.za/2011/04/05/bzier-curves-a-tutorial/

staticdrawCubicBezierPath (g2:Graphics, x:Array<Float>, y:Array<Float>, ?segments:Int, ?strength:Float):Void

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

staticdrawPolygon (g2:Graphics, x:Float, y:Float, vertices:Array<Vector2>, ?strength:Float):Void

Draws a convex polygon.

staticfillCircle (g2:Graphics, cx:Float, cy:Float, radius:Float, ?segments:Int):Void

Draws a filled circle.

Parameters:

segments

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

staticfillPolygon (g2:Graphics, x:Float, y:Float, vertices:Array<Vector2>):Void

Draws a filled convex polygon.