Scripting/Client/Functions/Draw3DTextWorld

v0.4+ (PC and Android): text as a real quad in the 3D world - it has a position, a rotation and a size in metres, is hidden by walls and cars (depth test) and is not a 2D screen overlay. Call it every frame from onClientRender. Rotation is in degrees: rz = heading (like Player.Angle), rx = pitch, ry = roll; (0, 0, 0) stands the text upright with its front facing -Y (readable from the south). Size: one line is about 0.55 m tall times scaleY (width follows the text, times scaleX); \n starts a new line (up to 8). distance > 0 hides it beyond that range with a fade (nothing is drawn beyond 400 m). colour is a Colour or 0xAARRGGBB; the text gets a black outline. Visible from both sides (mirrored from behind). Max 256 world quads per frame.

Syntax

Draw3DTextWorld(text, x, y, z, rx, ry, rz [, scaleX [, scaleY [, distance [, colour]]]])
Draw3DTextWorld(text, Vector pos, Vector rot [, scaleX ...])

Arguments

Returns

bool

Example

function onScriptLoad()
{
	local pos = player.Pos;
	local result = Draw3DTextWorld( "Hello world", pos.x, pos.y, pos.z, 0.0, 0.0, 0.0 );
	MessagePlayer( "Draw3DTextWorld returned: " + result, player );
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Screen, world and camera

Categories: Client functions | Screen, world and camera