Scripting/Client/Functions/Draw3DText
Draws a label in the world on the frame you call it - call it every frame from onClientRender. radius > 0 hides it beyond that distance with a fade. Max 512 per frame. For a text you want to edit, move or check against walls use the Text3D class (9.6).
Syntax
Draw3DText(text, x, y, z [, radius [, scaleX [, scaleY]]])Draw3DText(text, Vector [, radius [, scaleX [, scaleY]]])Arguments
- string text
- float x
- float y
- float z
- float radius (optional) –
radius> 0 hides it beyond that distance with a fade. - any scaleX (optional)
- any scaleY (optional)
- Vector value
Returns
bool
Example
function onScriptLoad()
{
local pos = player.Pos;
local result = Draw3DText( "Hello world", pos.x, pos.y, pos.z );
MessagePlayer( "Draw3DText returned: " + result, player );
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
- GetScreenWidth
- WorldPosToScreen
- ScreenPosToWorld
- GetGroundZLevel
- GetGroundZLevelForPos
- GetGroundZLevelForPosLoad
- Draw3DSprite
- Draw3DTextWorld
- Draw3DSpriteWorld
- SetCameraMatrix
- SetCameraTarget
- RestoreCamera
Section: Screen, world and camera
Categories: Client functions | Screen, world and camera