- Documentation
- Shared functions
- createWorldLabel
Function
createWorldLabel
Creates a permanent 3D label (a "worldlabel" element), drawn by the player's game with no Lua code each frame. Created on the server it is seen by everyone, on the client only by that player. It is visible only in range and in the same dimension and interior.
Syntax
element createWorldLabel(string text, float x, float y, float z [, table options = nil])Arguments
textstring- The label text.
xfloat- X.
yfloat- Y.
zfloat- Z.
optionstable, optional = nil- Options as in
dxDrawText3D, plusattachTo(an element) andoffset{x, y, z}.
Returns
The label; remove it with destroyElement.
Example
local label = createWorldLabel("Urząd miasta", 1481, -1771, 19, { maxDistance = 40, color = tocolor(255, 220, 0) })
setElementDimension(label, 0)
See also
setWorldLabelTextChanges the text of a 3D label.setWorldLabelOptionsChanges a 3D label's options (the same as increateWorldLabel). Omitted options stay unchanged;attachTo = falsedetaches the label.dxDrawText3DDraws a label at a point in the world. Call it fromonClientRender. The label shrinks with distance and fades out at the end of the range.