AddTextElement

From GT-MP
Jump to: navigation, search
AddTextElement
Client-Side Function
System-users.png Client-Side Javascript.png JavaScript

Adds a text element on the screen. Essentially is the same as DrawText, but you don't need to draw it every frame yourself.


Syntax

API.addTextElement(string caption, double x, double y, double scale, int r, int g, int b, int a, int font, int alignment);

Required Arguments

  • caption: parameter input should be in string type.
  • x: parameter input should be in double type.
  • y: parameter input should be in double type.
  • scale: parameter input should be in double type.
  • r: parameter input should be in int type.
  • g: parameter input should be in int type.
  • b: parameter input should be in int type.
  • a: parameter input should be in int type.
  • font: parameter input should be in int type.
  • alignment: parameter input should be in int type.

NOTE: This function returns data in UIResText type.

Usage example(s)

API.addTextElement("Example text\nScale 1, Font 1", 600.0, 200.0, 1.0, 0, 255, 0, 255, 1, -1);

AddTextElement example 2.png

References