⚠️ Not tested much in the game yet.
A few lines of text drawn over the game, so you can watch your mod's state while you drive. It's a small box in the top left corner of the game window, and clicks go straight through it.
Thread: any.
Example
Show your car's speed, gear and RPM while you drive.
protected override void OnInit()
{
DebugOverlay.Visible = true;
Game.Tick += () =>
{
if (Player.Car is { } car)
DebugOverlay.Text = $"speed {car.SpeedKmh:0} km/h\ngear {car.Gear}\nrpm {car.Rpm:0}";
};
}
Protected Overrides Sub OnInit()
DebugOverlay.Visible = True
AddHandler Game.Tick, Sub()
Dim car = Player.Car
If car IsNot Nothing Then
DebugOverlay.Text = $"speed {car.SpeedKmh:0} km/h{vbLf}gear {car.Gear}{vbLf}rpm {car.Rpm:0}"
End If
End Sub
End Sub
Members
| Member | What it does |
|---|---|
Visible (property, bool, get/set) | Shows or hides the box. |
Text (property, string, get/set) | What the box shows: one line per line of text. Setting null/Nothing makes it empty. |
Notes
- The game must be in borderless or windowed mode. It doesn't show over exclusive fullscreen.
- Up to 40 lines are shown. Lines after that are left out.
- Split lines with
\nin C# orvbLfin VB.NET. - The box is a fixed width (about 1100 pixels), so very long lines are cut off.
- The box updates about 10 times a second.
- If your mod is reloaded, the box is hidden. Set
Visibleagain in your new copy. DebugOverlaydraws its own window and doesn't use the game's code, so it doesn't switch itself off on an unsupported game build.
See also
- UI and Hud (messages for players)
- GameWindow
- Game
- Threads
