Constructor
Variables
alpha : Float
The alpha value to draw. Ranges between 0-1 where 0 is completely transparent and 1 is opaque.
The blending mode used by Draw functions. This will not apply to Draw.line(), but will apply to Draw.linePlus().
Functions
arc (x : Float, y : Float, radius : Float, start : Float, angle : Float, segments : Int = 25) : Void
Draws a circle to the screen.
Parameters:
x | X position of the circle's center. | |
y | Y position of the circle's center. | |
radius | Radius of the circle. | |
start | The starting angle in radians. | |
angle | The arc size in radians. | |
segments | Increasing will smooth the circle but takes longer to render. Must be a value greater than zero. |
circle (x : Float, y : Float, radius : Float, segments : Int = 25, scaleX : Float = 1, scaleY : Float = 1) : Void
Draws a circle to the screen.
Parameters:
x | X position of the circle's center. | |
y | Y position of the circle's center. | |
radius | Radius of the circle. | |
segments | Increasing will smooth the circle but takes longer to render. Must be a value greater than zero. | |
scaleX | Scales the circle horizontally. | |
scaleY | Scales the circle vertically. |
circleFilled (x : Float, y : Float, radius : Float, segments : Int = 25, scaleX : Float = 1, scaleY : Float = 1) : Void
Draws a circle to the screen.
Parameters:
x | X position of the circle's center. | |
y | Y position of the circle's center. | |
radius | Radius of the circle. | |
segments | Increasing will smooth the circle but takes longer to render. Must be a value greater than zero. | |
scaleX | Scales the circle horizontally. | |
scaleY | Scales the circle vertically. |
curve (x1 : Int, y1 : Int, x2 : Int, y2 : Int, x3 : Int, y3 : Int, segments : Int = 25) : Void
Draws a quadratic curve.
Parameters:
x1 | X start. | |
y1 | Y start. | |
x2 | X control point, used to determine the curve. | |
y2 | Y control point, used to determine the curve. | |
x3 | X finish. | |
y3 | Y finish. | |
segments | Increasing will smooth the curve but takes longer to render. Must be a value greater than zero. |
line (x1 : Float, y1 : Float, x2 : Float, y2 : Float) : Void
Draws a straight line.
Parameters:
x1 | Starting x position. | |
y1 | Starting y position. | |
x2 | Ending x position. | |
y2 | Ending y position. |
polyline (points : Array<Float>, miterJoint : Bool = false) : Void
Draws a triangulated line polyline to the screen. This must be a closed loop of concave lines
Parameters:
points | An array of floats containing the points of the polyline. The array is ordered in x, y format and must have an even number of values. |
rect (x : Float, y : Float, width : Float, height : Float) : Void
Draws a rectangle outline. Lines are drawn inside the width and height.
Parameters:
x | X position of the rectangle. | |
y | Y position of the rectangle. | |
width | Width of the rectangle. | |
height | Height of the rectangle. |
Available since:
2.5.2
rectFilled (x : Float, y : Float, width : Float, height : Float) : Void
Draws a filled rectangle.
Parameters:
x | X position of the rectangle. | |
y | Y position of the rectangle. | |
width | Width of the rectangle. | |
height | Height of the rectangle. |
Available since:
4.0.0
setColor (color : Color = 0xFFFFFF, alpha : Float = 1) : Void
Convenience function to set both color and alpha at the same time.