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.


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.


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

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

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.


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

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

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

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.


setLineText

Available since version: 0.1.10

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

void setLineText(int position, string the)

Parameters:

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

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.