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

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

Available since version: 0.1.0

Represents the visibility state of the text.


string font

Available since version: 0.1.0

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.


Methods

top

Available since version: 0.1.0

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()

setColor

Available since version: 0.1.0

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

Available since version: 0.1.0

This method will get the text color.

{r, g, b} getColor()

Returns {r, g, b}:

the draw 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.


insertText

Available since version: 0.1.0

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

Available since version: 0.1.0

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

Available since version: 0.1.0

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

Available since version: 0.1.0

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.


setWorldPosition

Available since version: 0.1.0

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

Available since version: 0.1.0

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

{x, y, z} getWorldPosition()

Returns {x, y, z}:

the draw3d world position.