Skip to content
NicEastvillage edited this page Feb 23, 2021 · 2 revisions

Rendering in RLBot is a useful tool to draw information about your bot directly in Rocket League. For example, you can draw the predicted ball path, location of your car, the path the bot will take, and more. The Bot class (the class that your bot inherits) has a Renderer property that you can use for rendering.

Example gif of rendering

Example rendering code:

Renderer.DrawString2D("Hello world!", Colors.Red, new Vector2(0, 0), 3, 3);

Enabling/disabling of rendering

When installing the RLBotGUI, rendering will be disabled by default. You can turn it on by clicking 'Extra' and ticking 'Enable Rendering' in the GUI. However, rendering can also be enabled or disabled any time using the page up and page down keys, respectively. So if your rendering isn't appearing, make sure to press page up before panicking.

Precautions

If you get errors with not finding colors, make sure you've added using System.Windows.Media; at the top of the file and you've addedPresentationCore.dll in your solution's references. You might want to also add using Color = System.Windows.Media.Color; at the start of your file for convenience.

The methods for Renderer use Vector2s and Vector3s found in the System.Numerics namespace. You'll need to add this namespace to with a using directive to use these Vector classes for rendering.

Color

You can use your own color instead of the ones defined in the Colors class like so:

Color.FromRgb(150, 200, 0);

The Color struct has a lot of other useful methods that you might be interested in.

Examples of methods

The following methods should be picked up by Intellisense when you autocomplete Renderer's methods. If you see a method in Intellisense but not in the following list, the method may not be supported right now in RLBot. Note that some of these clips may be slightly outdated in terms of looks, but the functionality is the same.

Renderer.DrawRectangle2D

Draws a rectangle on screen.

Renderer.DrawString2D

Draws 2D text flat on the screen.

Renderer.DrawRectangle3D

Draws a 2D rectangle in game's 3D space.

Renderer.DrawString3D

Draws 2D text in game's 3D space.

Renderer.DrawLine2D

Draws a 2D line in game's 3D space.

Renderer.DrawPolyline3D

Draws multiple connected lines in the game's 3D space. Useful for rendering paths.

Renderer.EraseFromScreen

Clears all drawings on the screen.