Navigation
Browse the developer docs

FH2 Mod Platform for .NET

DebugOverlay

A few lines of text over the game, to watch your mod's state while you drive.

By Bartholomew Ho (qiangqiang101) · MIT license · v0.12.0 · 15 Nov 2026 · repository · original page

On this page

⚠️ 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

MemberWhat 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 \n in C# or vbLf in 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 Visible again in your new copy.
  • DebugOverlay draws 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

Copied from the wiki page DebugOverlay at commit 7396a07 · MIT license
MIT License

Copyright (c) 2026 Bartholomew Ho

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.