A basic 2D polygon. More...
#include <polygon.hpp>
Public Member Functions | |
| Polygon (color_t color, const std::initializer_list< Coords > &&points, bool fill=false) | |
| Construct polygon from a set list of points. | |
| Polygon (color_t color, bool fill=false) | |
| Construct a polygon without any points. | |
| void | renderAt (const Coords &coords, const shader_t &shader) const override |
| Display the renderable directly onto the screen. | |
| Size | getSize () const override |
| Get the size of the renderable. | |
Public Attributes | |
| bool | fill |
| Whether the shape is filled or just an outline. | |
| color_t | color |
| The color of the polygon. | |
| std::vector< Coords > | points |
| The polygon vertices. | |
A basic 2D polygon.
fill to true on self-intersecting polygons may yield unexpected results. | ui::Polygon::Polygon | ( | color_t | color, |
| const std::initializer_list< Coords > && | points, | ||
| bool | fill = false |
||
| ) |
Construct polygon from a set list of points.
| color | The polygon color. |
| points | A list of points. |
| fill | Whether to fill the polygon or just draw an outline. |
| ui::Polygon::Polygon | ( | color_t | color, |
| bool | fill = false |
||
| ) |
Construct a polygon without any points.
| color | The polygon color. |
| fill | Whether to fill the polygon or just draw an outline. |
|
overridevirtual |
Get the size of the renderable.
Implements ui::Renderable.
Display the renderable directly onto the screen.
| coords | The coordinates to render the first pixel [0,0] of the renderable. |
| shader | An optional pixel shader to apply to each pixel of the renderable. |
Implements ui::Renderable.