void Text( Vector3 position, string text, float size, TextFlag flags, Color color, float duration, Transform transform, bool overlay )
void Text( Vector3 position, Sandbox.TextRendering/Scope scope, TextFlag flags, float duration, Transform transform, bool overlay )

robot_2Generated
code_blocksInput

Description

The Text method of the DebugOverlaySystem class is used to draw text in the 3D world space. This method allows you to specify the position, content, size, and appearance of the text, as well as how long it should be displayed.

Usage

To use the Text method, you need to provide the following parameters:

  • position: A Vector3 representing the world position where the text should be drawn.
  • text: A string containing the text to be displayed.
  • size: A float specifying the size of the text.
  • flags: A TextFlag enumeration value that determines the text alignment and other properties.
  • color: A Color object defining the color of the text.
  • duration: A float indicating how long the text should remain visible, in seconds.
  • transform: A Transform object that can be used to apply additional transformations to the text.
  • overlay: A bool indicating whether the text should be drawn as an overlay (true) or in the world (false).

Example

// Example of using the Text method to draw text in the world
var position = new Vector3(0, 0, 0);
var text = "Hello, World!";
var size = 12.0f;
var flags = TextFlag.Center;
var color = Color.White;
var duration = 5.0f;
var transform = new Transform();
var overlay = false;

DebugOverlaySystem.Text(position, text, size, flags, color, duration, transform, overlay);