Skip to content

class Line (client-side)

Available since version: 0.1.10

This class represents 2d line visible on the screen.

Constructor

Line(int x1, int y1, int x2, int y2)

Parameters:

  • int x1: the beginning x position of the line in virtuals.
  • int y1: the beginning y position of the line in virtuals.
  • int x2: the end x position of the line in virtuals.
  • int y2: the end y position of the line in virtuals.

Properties

bool visible

Represents the visibility state of the line.


Methods

top

This method will move the line at the end of the render queue.
It will be visible at the top of the screen (other elements will be covered by it).

void top()

setBegin

This method will set the beginning point of the line.

void setBegin(int x, int y)

Parameters:

  • int x: the x position in virtuals.
  • int y: the y position in virtuals.

setEnd

This method will set the end point of the line.

void setEnd(int x, int y)

Parameters:

  • int x: the x position in virtuals.
  • int y: the y position in virtuals.

setColor

This method will set the line color.

void setColor(int r, int g, int b)

Parameters:

  • int r: the red color component in RGB model.
  • int g: the green color component in RGB model.
  • int b: the blue color component in RGB model.

getBegin

This method will get the position of the beginning point of the line.

{ x, y } getBegin()

Returns { x, y }:

the beginning position of the line on screen in virtuals.


getEnd

This method will get the position of the end point of the line.

{ x, y } getEnd()

Returns { x, y }:

the end position of the line on screen in virtuals.


getColor

This method will get the line color.

{r, g, b} getColor()

Returns {r, g, b}:

the line color.