18
18
19
19
//| class Polygon:
20
20
//| def __init__(self, pixel_shader: Union[displayio.ColorConverter, displayio.Palette], points: List[Tuple[int, int]], x: int, y: int) -> None:
21
- //| """Represents a closed shape by ordered vertices
21
+ //| """Represents a closed shape by ordered vertices. The path will be treated as
22
+ //| 'closed', the last point will connect to the first point.
22
23
//|
23
- //| :param pixel_shader: The pixel shader that produces colors from values
24
- //| :param points: Vertices for the polygon
25
- //| :param x: Initial screen x position of the 0,0 origin in the points list.
26
- //| :param y: Initial screen y position of the 0,0 origin in the points list."""
24
+ //| :param Union[~displayio.ColorConverter,~displayio.Palette] pixel_shader: The pixel
25
+ //| shader that produces colors from values
26
+ //| :param List[Tuple[int,int]] points: Vertices for the polygon
27
+ //| :param int x: Initial screen x position of the 0,0 origin in the points list.
28
+ //| :param int y: Initial screen y position of the 0,0 origin in the points list."""
27
29
//|
28
30
static mp_obj_t vectorio_polygon_make_new (const mp_obj_type_t * type , size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
29
31
enum { ARG_pixel_shader , ARG_points_list , ARG_x , ARG_y };
@@ -63,7 +65,7 @@ STATIC const vectorio_draw_protocol_t polygon_draw_protocol = {
63
65
64
66
65
67
//| points: List[Tuple[int, int]]
66
- //| """Set a new look and shape for this polygon"""
68
+ //| """Vertices for the polygon. """
67
69
//|
68
70
STATIC mp_obj_t vectorio_polygon_obj_get_points (mp_obj_t self_in ) {
69
71
vectorio_polygon_t * self = MP_OBJ_TO_PTR (self_in );
@@ -86,6 +88,22 @@ const mp_obj_property_t vectorio_polygon_points_obj = {
86
88
MP_ROM_NONE },
87
89
};
88
90
91
+
92
+ // Documentation for properties inherited from VectorShape.
93
+
94
+ //| x : int
95
+ //| """X position of the 0,0 origin in the points list."""
96
+ //|
97
+ //| y : int
98
+ //| """Y position of the 0,0 origin in the points list."""
99
+ //|
100
+ //| location : Tuple[int,int]
101
+ //| """(X,Y) position of the 0,0 origin in the points list."""
102
+ //|
103
+ //| pixel_shader : Union[displayio.ColorConverter,displayio.Palette]
104
+ //| """The pixel shader of the polygon."""
105
+ //|
106
+
89
107
STATIC const mp_rom_map_elem_t vectorio_polygon_locals_dict_table [] = {
90
108
// Properties
91
109
{ MP_ROM_QSTR (MP_QSTR_points ), MP_ROM_PTR (& vectorio_polygon_points_obj ) },
0 commit comments