A subclass of Drawable that represents a line in 2D space.
More...
#include <line.h>
A subclass of Drawable that represents a line in 2D space.
◆ Line()
Line::Line |
( |
const Vector2 & |
a, |
|
|
const Vector2 & |
b, |
|
|
const cs225::HSLAPixel & |
color |
|
) |
| |
Constructs a new Line going from Point a to Point b.
- Parameters
-
◆ a()
Gets starting point of the Line.
- Returns
- the starting point of the Line
◆ b()
Gets the ending point of the Line.
- Returns
- the ending point of the Line
◆ color()
HSLAPixel Line::color |
( |
| ) |
const |
Gets the color of the Line.
- Returns
- the color of the Line
◆ draw()
void Line::draw |
( |
cs225::PNG * |
canvas | ) |
const |
|
virtual |
Draws the Line onto the canvas.
- Parameters
-
Implements Drawable.
◆ set_a()
void Line::set_a |
( |
const Vector2 & |
a | ) |
|
Sets the starting point of the Line.
- Parameters
-
a | the new starting point of the Line |
◆ set_b()
void Line::set_b |
( |
const Vector2 & |
b | ) |
|
Sets the ending point of the Line.
- Parameters
-
b | the new ending point of the Line |
◆ set_color()
void Line::set_color |
( |
const cs225::HSLAPixel & |
color | ) |
|
Sets the color of the Line.
- Parameters
-
color | the new color of the Line |
The documentation for this class was generated from the following files: