void Text( Vector3 position, string text, float size, TextFlag flags, Color color, float duration, bool overlay )
void Text( Vector3 position, Sandbox.TextRendering/Scope scope, TextFlag flags, float duration, 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 will be drawn.
  • text: A string containing the text to be displayed.
  • size: A float indicating the size of the text.
  • flags: A TextFlag enumeration value that specifies text rendering options, such as alignment and style.
  • color: A Color object that defines the color of the text.
  • duration: A float specifying how long the text should remain visible, in seconds.
  • 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
Vector3 position = new Vector3(0, 0, 0);
string text = "Hello, World!";
float size = 12.0f;
TextFlag flags = TextFlag.Center;
Color color = Color.White;
float duration = 5.0f;
bool overlay = false;

DebugOverlaySystem debugOverlay = new DebugOverlaySystem();
debugOverlay.Text(position, text, size, flags, color, duration, overlay);