# Line

#### new Line(x1, y1, x2, y2)

##### Parameters:

Name | Type | Description
--- | --- | ---
`x1` | number | x coordinate of starting point of line.
`y1` | number | y coordinate of starting point of line.
`x2` | number | x coordinate of end point of line.
`y2` | number | y coordinate of end point of line.

Source:
  - graphics/line.js, line 5

### Extends

- Thing

### Methods

#### containsPoint(x, y)

Checks if a given point is contained in the line. Will always be false, just written as an override.

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | number | x coordinate of the point being tested.
`y` | number | y coordinate of the point being tested.

Overrides:
  - Thing#containsPoint
Source:
  - graphics/line.js, line 67

#### draw(__graphics__)

Draws the line in the canvas.

##### Parameters:

Name | Type | Description
--- | --- | ---
`__graphics__` | CodeHSGraphics | Instance of the __graphics__ module.

Overrides:
  - Thing#draw
Source:
  - graphics/line.js, line 49

#### getBorderColor() → {Color}

Gets the border color of a Thing.

Inherited From:
  - Thing#getBorderColor
Source:
  - graphics/thing.js, line 142

##### Returns:

The color of the Thing's border.

Type
  Color

#### getBorderWidth() → {number}

Gets the width of the Thing's border.

Inherited From:
  - Thing#getBorderWidth
Source:
  - graphics/thing.js, line 163

##### Returns:

The width of the Thing's border.

Type
  number

#### getColor() → {Color}

Gets the color of a line.

Overrides:
  - Thing#getColor
Source:
  - graphics/line.js, line 41

##### Returns:

Color of the line.

Type
  Color

#### getHeight() → {number}

Returns the height of the line.

Source:
  - graphics/line.js, line 83

##### Returns:

The width of the line.

Type
  number

#### getType() → {type}

Returns the type of a Thing.

Inherited From:
  - Thing#getType
Source:
  - graphics/thing.js, line 73

##### Returns:

The type of the Thing.

Type
  type

#### getWidth() → {number}

Returns the width of the line.

Source:
  - graphics/line.js, line 75

##### Returns:

The width of the line.

Type
  number

#### getX() → {number}

Gets the x position of the Thing.

Inherited From:
  - Thing#getX
Source:
  - graphics/thing.js, line 190

##### Returns:

The x position of the Thing.

Type
  number

#### getY() → {number}

Gets the y position of the Thing.

Inherited From:
  - Thing#getY
Source:
  - graphics/thing.js, line 198

##### Returns:

The y position of the Thing.

Type
  number

#### hasBorder() → {boolean}

Returns if a Thing has a border.

Inherited From:
  - Thing#hasBorder
Source:
  - graphics/thing.js, line 53

##### Returns:

True if the Thing has a border.

Type
  boolean

#### isFilled() → {boolean}

Returns if a Thing is filled.

Inherited From:
  - Thing#isFilled
Source:
  - graphics/thing.js, line 33

##### Returns:

True if the Thing is filled.

Type
  boolean

#### move(dx, y)

Moves the entire line.

##### Parameters:

Name | Type | Description
--- | --- | ---
`dx` | number | The change in x coordinate of both starting and ending points.
`y` | number | The change in y coordinate of both starting and ending points.

Overrides:
  - Thing#move
Source:
  - graphics/line.js, line 129

#### setBorder(hasBorder)

Sets a Thing object to filled. Throws an error if an argument is not passed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`hasBorder` | bool | A boolean of whether or not Thing has a border.

Inherited From:
  - Thing#setBorder
Source:
  - graphics/thing.js, line 42

#### setBorderColor(color)

Sets the border color of a Thing. Throws an error if there are fewer than 1 params or if the param is undefined.

##### Parameters:

Name | Type | Description
--- | --- | ---
`color` | Color | The resulting color of the Thing's border.

Inherited From:
  - Thing#setBorderColor
Source:
  - graphics/thing.js, line 128

#### setBorderWidth(width)

Sets the width of a Thing's border. Throws an error if there is not 1 argument.

##### Parameters:

Name | Type | Description
--- | --- | ---
`width` | number | The resulting width of the Thing's border.

Inherited From:
  - Thing#setBorderWidth
Source:
  - graphics/thing.js, line 151

#### setColor(color)

Sets the color of a line.

##### Parameters:

Name | Type | Description
--- | --- | ---
`color` | Color | Sets the color of the line.

Overrides:
  - Thing#setColor
Source:
  - graphics/line.js, line 33

#### setEndpoint(x, y)

Sets the *ending* point of the line.

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | number | The x coordinate of the resulting ending point.
`y` | number | The y coordinate of the resulting ending point.

Source:
  - graphics/line.js, line 116

#### setFilled(filled)

Sets a Thing object to filled. Throws an error if an argument is not passed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`filled` | bool | A boolean of whether or not Thing is filled.

Inherited From:
  - Thing#setFilled
Source:
  - graphics/thing.js, line 22

#### setLineWidth(width)

Sets the width of the line.

##### Parameters:

Name | Type | Description
--- | --- | ---
`width` | number | The resulting width of the line.

Source:
  - graphics/line.js, line 91

#### setPosition(x, y)

Sets the *starting* point of the line.

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | number | The x coordinate of the resulting starting point.
`y` | number | The y coordinate of the resulting starting point.

Overrides:
  - Thing#setPosition
Source:
  - graphics/line.js, line 103

#### setType(type)

Sets a Thing object's type. Questionable of whether or not this method is used.

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | type | A type to set the Thing to.

Inherited From:
  - Thing#setType
Source:
  - graphics/thing.js, line 62