Dualie
Loading...
Searching...
No Matches
dl::Line Class Reference

A simple class responsible for the line object. More...

#include <Line.hpp>

Inheritance diagram for dl::Line:
Collaboration diagram for dl::Line:

Public Member Functions

 Line (dl::Vector2f startingPosition, dl::Vector2f endingPosition, float thickness=1)
 
void draw (const Vector2f &viewOffset) override
 Draws the drawable to the screen.
 
void setStartingPosition (const dl::Vector2f &startingPosition)
 Sets the starting position of the line.
 
void setEndingPosition (const dl::Vector2f &endingPosition)
 Sets the ending position of the line.
 
void setThickness (float thickness)
 Sets the thickness of the line.
 
void setColor (const dl::Color &color)
 Sets the color of the line.
 
const dl::Vector2fgetStartingPosition ()
 
const dl::Vector2fgetEndingPosition ()
 
float getThickness ()
 
const dl::ColorgetColor ()
 
- Public Member Functions inherited from dl::Drawable
void viewShouldAffect (bool effective)
 Set whether the current view should affect the position of the drawable. Otherwise, its position on the screen will be absolute.
 
void setDepth (float depth)
 Sets the depth of the drawable for 3d. This simply corresponds to the X offset calculated for the 2 separate top screens. Larger objects will require a deeper depth for the 3d effect to be noticable. A positive value will cause the drawable to sink into the screen, while a negative value will cause it to pop out.
 
const float & getDepth () const
 

Additional Inherited Members

- Protected Attributes inherited from dl::Drawable
bool m_bViewDoesAffect = true
 
float m_depth = 0.0f
 

Detailed Description

A simple class responsible for the line object.

Member Function Documentation

◆ draw()

void dl::Line::draw ( const Vector2f & viewOffset)
overridevirtual

Draws the drawable to the screen.

Parameters
viewOffsetThe offset of the current view to be used for internal drawable positioning

Implements dl::Drawable.

◆ getColor()

const dl::Color & dl::Line::getColor ( )
Returns
The color of the line

◆ getEndingPosition()

const dl::Vector2f & dl::Line::getEndingPosition ( )
Returns
The ending position of the line

◆ getStartingPosition()

const dl::Vector2f & dl::Line::getStartingPosition ( )
Returns
The starting position of the line

◆ getThickness()

float dl::Line::getThickness ( )
Returns
The thickness of the line

◆ setColor()

void dl::Line::setColor ( const dl::Color & color)

Sets the color of the line.

Parameters
thicknessThe color of the line

◆ setEndingPosition()

void dl::Line::setEndingPosition ( const dl::Vector2f & endingPosition)

Sets the ending position of the line.

Parameters
startingPositionThe ending position of the line

◆ setStartingPosition()

void dl::Line::setStartingPosition ( const dl::Vector2f & startingPosition)

Sets the starting position of the line.

Parameters
startingPositionThe starting position of the line

◆ setThickness()

void dl::Line::setThickness ( float thickness)

Sets the thickness of the line.

Parameters
thicknessThe thickness of the line

The documentation for this class was generated from the following files: