Skip to content

drawArc()

Draw an arc straight onto the display.

display.drawArc(x1, y1, x2, y2)

The arc is part of the oval that fills the box with corners (x1, y1) and (x2, y2). Angles are in degrees, with 0 at the three o'clock position; a positive angle goes counter-clockwise, a negative one clockwise. The constants HALF_PI, PI, and TWO_PI may be used for the angles. This draws to the canvas and returns nothing, which is fast and best for shapes you will not change later. To keep a handle you can move or delete, create an Arc and add() it instead. Erase these drawings with clearDrawing().

Parameters

display.drawArc(x1, y1, x2, y2, startAngle=PI, endAngle=TWO_PI, style=OPEN, color=Color.BLACK, fill=False, thickness=1, rotation=0)
Parameter Type Default Description
x1 int or float required The horizontal position of the box's top-left corner, in pixels.
y1 int or float required The vertical position of the box's top-left corner, in pixels.
x2 int or float required The horizontal position of the box's bottom-right corner, in pixels.
y2 int or float required The vertical position of the box's bottom-right corner, in pixels.
startAngle int or float PI The starting angle, in degrees.
endAngle int or float TWO_PI The ending angle, in degrees.
style int OPEN The arc style, one of OPEN (an open arc), CHORD (closed with a straight line between the ends), or PIE (closed with two lines to the center).
color Color Color.BLACK The color.
fill bool False Whether the arc is filled in (True) or just an outline (False).
thickness int 1 The outline thickness, in pixels.
rotation int or float 0 How far to turn the arc, in degrees, counter-clockwise.