-
Notifications
You must be signed in to change notification settings - Fork 21
Rendering
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 rendering code:
Renderer.DrawString2D("Hello world!", Colors.Red, new Vector2(0, 0), 3, 3);
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.
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 Vector2
s and Vector3
s 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.
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.
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.
Draws 2D text flat on the screen.
Draws a 2D rectangle in game's 3D space.
Draws 2D text in game's 3D space.
Draws a 2D line in game's 3D space.
Draws multiple connected lines in the game's 3D space. Useful for rendering paths.
Clears all drawings on the screen.