Line

Chameleon\Primitives\Line

  • Class name: Line
  • Namespace: Chameleon\Primitives
  • Fully qualified class name: Chameleon\Primitives\Line
  • Implements: Chameleon\Primitives\IPrimitive

    Methods

    __construct()

    void Line::__construct(Vector2 $start, Vector2 $end)

Class constructor

Arguments

  • $start Vector2 - <p>Start vector</p>
  • $end Vector2 - <p>End vector</p>

getStart()

Vector2 Line::getStart()

Get start vector

Arguments

None.


setStart()

Line Line::setStart(Vector2 $start)

Set start vector

Arguments

  • $start Vector2 - <p>The start vector</p>

getEnd()

Vector2 Line::getEnd()

Get end vector

Arguments

None.


setEnd()

Line Line::setEnd(Vector2 $end)

Set end vector

Arguments

  • $end Vector2 - <p>The end vector</p>

getThickness()

integer Line::getThickness()

Get line thickness in px

Arguments

None.


setThickness()

Line Line::setThickness(integer $thickness)

Set line thickness

Arguments

  • $thickness integer - <p>Thickness in px</p>

getColor()

IColor Line::getColor()

Get line color

Arguments

None.


setColor()

Line Line::setColor(IColor $color)

Set line color

Arguments

  • $color IColor - <p>The color</p>

getPosition()

Vector2 IPrimitive::getPosition()

Get Primitive position


setPosition()

IPrimitive IPrimitive::setPosition(Vector2 $point)

Set the position of this primitive


draw()

IPrimitive IPrimitive::draw(Image $image)

Draw this primitive onto the image