- Documentation
- Client functions
- dxDrawText3D
Function
dxDrawText3D
Draws a label at a point in the world. Call it from onClientRender. The label shrinks with distance and fades out at the end of the range.
Syntax
bool dxDrawText3D(string text, float x, float y, float z [, table options = nil])Arguments
textstring- The text.
xfloat- X.
yfloat- Y.
zfloat- Z.
optionstable, optional = nilmaxDistance(20),fadeDistance(5),scale(1),minScale(0.5),fixedScale,font,color,shadow(true),colorCoded,checkLineOfSight.
Returns
true if the label was drawn.
Example
addEventHandler("onClientRender", root, function()
dxDrawText3D("#ffcc00Bankomat", 1500, -1680, 15, { colorCoded = true, maxDistance = 15 })
end)
Notes
For permanent labels createWorldLabel is better: it needs no code every frame.
See also
createWorldLabelCreates 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.dxDrawTextDraws text on the screen for one frame. Call it inonClientRenderto keep it visible.