From 026e71db7bade95b4fb7e415fc573c5b77482add Mon Sep 17 00:00:00 2001 From: LingSamuel Date: Tue, 26 Nov 2024 20:13:03 +0800 Subject: [PATCH] Add api doc --- README.md | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/README.md b/README.md index 9e8b3df..6aa58c2 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,35 @@ Draws the outline of a rectangle --- +### `d2d.rounded_rect(x, y, w, h, rX, rY, thickness, color)` +Draws the outline of a rounded rectangle + +#### Params +* `x` the horizontal position on the screen +* `y` the vertical position on the screen +* `w` the width of the rectangle +* `h` the height of the rectangle +* `rX` the corner radius X +* `rY` the corner radius Y +* `thickness` the thickness of the outline +* `color` the ARGB color of the rectangle + +--- + +### `d2d.fill_rounded_rect(x, y, w, h, rX, rY, color)` +Draws a filled in a rounded rectangle + +#### Params +* `x` the horizontal position on the screen +* `y` the vertical position on the screen +* `w` the width of the rectangle +* `h` the height of the rectangle +* `rX` the corner radius X +* `rY` the corner radius Y +* `color` the ARGB color of the rectangle + +--- + ### `d2d.line(x1, y1, x2, y2, thickness, color)` Draws a line between two points @@ -167,6 +196,82 @@ Draws a line between two points --- +### `d2d.circle(x, y, r, thickness, color)` +Draws the outline of a circle + +#### Params +* `x` the horizontal center on the screen +* `y` the vertical center on the screen +* `r` the radius of the circle +* `thickness` the thickness of the outline +* `color` the ARGB color of the circle + +--- + +### `d2d.fill_circle(x, y, r, color)` +Draws a filled in a circle + +#### Params +* `x` the horizontal center on the screen +* `y` the vertical center on the screen +* `r` the radius of the circle +* `color` the ARGB color of the circle + +--- + +### `d2d.oval(x, y, rX, rY, thickness, color)` +Draws the outline of a oval + +#### Params +* `x` the horizontal center on the screen +* `y` the vertical center on the screen +* `rX` the horizontal radius of the oval +* `rY` the vertical radius of the oval +* `thickness` the thickness of the outline +* `color` the ARGB color of the oval + +--- + +### `d2d.fill_oval(x, y, rX, rY, color)` +Draws a filled in a oval + +#### Params +* `x` the horizontal center on the screen +* `y` the vertical center on the screen +* `rX` the horizontal radius of the oval +* `rY` the vertical radius of the oval +* `color` the ARGB color of the oval + +--- + +### `d2d.pie(x, y, r, startAngle, sweepAngle, color, clockwise)` +Draws a filled pie + +#### Params +* `x` the horizontal center on the screen +* `y` the vertical center on the screen +* `startAngle` the pie start angle, range from -360 to 360. +* `sweepAngle` the pie sweep angle, range from 0 to 360. +* `color` the ARGB color of the pie +* `clockwise` by default is true, clockwise. Set false to counter clockwise. + +--- + +### `d2d.ring(x, y, outerRadius, innerRadius, startAngle, sweepAngle, color, clockwise)` +Draws a filled ring + +#### Params +* `x` the horizontal center on the screen +* `y` the vertical center on the screen +* `outerRadius` the ring outer radius +* `innerRadius` the ring inner radius +* `startAngle` the pie start angle, range from -360 to 360. +* `sweepAngle` the pie sweep angle, range from 0 to 360. +* `color` the ARGB color of the pie +* `clockwise` by default is true, clockwise. Set false to counter clockwise. + +--- + ### `d2d.image(image, x, y, [w], [h])` Draws an image at the specified position, optionally scaled.