Skip to content

class Draw3d (client-side)

Available since version: 0.1.0

This class represents text visible on the screen.
The text will be shown and follow specified world position, when player is in the distance.

Constructor

Draw3d(float x, float y, float z)

Parameters:

  • float x: the position in the world on the x axis.
  • float y: the position in the world on the y axis.
  • float z: the position in the world on the z axis.

Properties

bool visible

Represents the visibility state of the text.


string font

Represents the font name used by the text.


int alpha

Available since version: 0.1.10

Represents the text alpha color component in RGBA model.


int distance

Available since version: 0.1.5.6

Represents the minimum distance needed between player and draw3d, in order to display it.


int width (read-only)

Available since version: 0.1.10

Represents the width of the text in virtuals.


int widthPx (read-only)

Available since version: 0.1.10

Represents the width of the text in pixels.


int height (read-only)

Available since version: 0.1.10

Represents the height of the text in virtuals.


int heightPx (read-only)

Available since version: 0.1.10

Represents the height of the text in pixels.


int linesCount (read-only)

Available since version: 0.2.1

Represents the number of text lines.


Methods

top

This method will move the draw text 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()

setLineFont

Available since version: 0.1.10

This method will set the line of text alpha channel.

void setLineFont(int position, int alpha)

Parameters:

  • int position: the position of target line in the draw3d.
  • int alpha: the alpha color component in RGBA model.

getLineFont

Available since version: 0.1.10

This method will get the line of text alpha channel.

int getLineFont(int position)

Parameters:

  • int position: the position of target line in the draw3d.

Returns int:

the alpha color component in RGBA model.


setColor

This method will set the text 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.

getColor

This method will get the text color.

{r, g, b} getColor()

Returns {r, g, b}:

the draw color.


setLineColor

Available since version: 0.1.10

This method will set the line of text color.

void setLineColor(int position, int r, int g, int b)

Parameters:

  • int position: the position of target line in the draw3d.
  • 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.

getLineColor

Available since version: 0.1.10

This method will get the line of text color.

{r, g, b} getLineColor(int position)

Parameters:

  • int position: the position of target line in the draw3d.

Returns {r, g, b}:

the line of text color.


setAlpha

Deprecated since version: 0.1.10

This method will set the text alpha channel.

void setAlpha(int alpha)

Parameters:

  • int alpha: the alpha color component in RGBA model.

getAlpha

Deprecated since version: 0.1.10

This method will get the text alpha channel.

int getAlpha()

Returns int:

the alpha color component in RGBA model.


setLineAlpha

Available since version: 0.1.10

This method will set the line of text alpha channel.

void setLineAlpha(int position, int alpha)

Parameters:

  • int position: the position of target line in the draw3d.
  • int alpha: the alpha color component in RGBA model.

getLineAlpha

Available since version: 0.1.10

This method will get the text alpha channel.

int getLineAlpha(int position)

Parameters:

  • int position: the position of target line in the draw3d.

Returns int:

the alpha color component in RGBA model.


insertText

This method will insert new line of text to the draw, moving all previously existing below.

void insertText(string text)

Parameters:

  • string text: the text that will be inserted.

removeText

This method will remove line of text from the draw at the specified position, moving up all lines below.

void removeText(int position)

Parameters:

  • int position: the position of target line in the draw3d.

updateText

Deprecated since version: 0.1.10

This method will update line of text at the specified position.

void updateText(int position, string text)

Parameters:

  • int position: the position of target line in the draw3d.
  • string text: the text that will be set.

getText

This method will get the line text at the specified position.

string getText(int position)

Parameters:

  • int position: the position of target line in the draw3d.

Returns string:

the text at specified position.


setLineText

Available since version: 0.1.10

This method will set line of text at the specified position.

void setLineText(int position, string line)

Parameters:

  • int position: the position of target line in the draw3d.
  • string line: the line of text that will be set.

getLineText

Available since version: 0.1.10

This method will get the line of text.

string getLineText(int position)

Parameters:

  • int position: the position of target line in the draw3d.

Returns string:

the line of text.


getPosition

Available since version: 0.1.10

This method will get the text position on screen in virtuals.

{x, y} getPosition()

Returns {x, y}:

the draw position on screen.


getPositionPx

Available since version: 0.1.10

This method will get the text position on screen in pixels.

{x, y} getPositionPx()

Returns {x, y}:

the draw position on screen.


setWorldPosition

This method will set the position of the text in the world.

void setWorldPosition(float x, float y, float z)

Parameters:

  • float x: the position in the world on the x axis.
  • float y: the position in the world on the y axis.
  • float z: the position in the world on the z axis.

getWorldPosition

This method will get the position of the text in the world.

{x, y, z} getWorldPosition()

Returns {x, y, z}:

the draw3d world position.