mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-01-11 20:02:12 +01:00
Add regular polygon shapes to display component (#3551)
This commit is contained in:
parent
3d9616b5eb
commit
4d279427e5
@ -101,6 +101,13 @@ and circles:
|
||||
// and a filled triangle !
|
||||
it.filled_triangle(125, 5, 105, 25, 150, 50);
|
||||
|
||||
// Regular Polygons? Let's draw the outline of a pointy-topped hexagon inscribed in a circle
|
||||
// centered on [x1=100,y1=100] with a radius of 50
|
||||
it.regular_polygon(100, 100, 50, EDGES_HEXAGON);
|
||||
// and a filled flat-topped octagon!
|
||||
it.filled_regular_polygon(200, 200, 50, EDGES_OCTAGON, VARIATION_FLAT_TOP);
|
||||
// Need to rotate the polygon, or retrieve the coordinates of its vertices? Check the API!
|
||||
|
||||
All the above methods can optionally also be called with an argument at the end which specifies in which
|
||||
color to draw. For monochrome displays, only ``COLOR_ON`` (the default if color is not given) and ``COLOR_OFF`` are supported.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user