Skip to content
kipje13 edited this page Aug 22, 2019 · 2 revisions

RLBot has support for drawing things on screen. This can be helpfull when debugging your bot.

Usage

Renderer::DrawLine3D(Color color, rlbot::flat::Vector3 start,
                     rlbot::flat::Vector3 end);

Draws a line from start to end using color.


Renderer::DrawPolyLine3D(Color color,
                         std::vector<const rlbot::flat::Vector3 *> points);

Draws a list of lines from points[0] to points[1] to points[2] etc. using color.


Renderer::DrawString2D(std::string text, Color color,
                       rlbot::flat::Vector3 upperLeft, int scaleX, int scaleY);

Draws string text on screen using color. Top left of the text starts at upperLeft, this is the distance in pixels to the top left of the game window, the z component is ignored. scaleX and scaleY resize the text, this is NOT the size in pixels.


Renderer::DrawString3D(std::string text, Color color,
                       rlbot::flat::Vector3 upperLeft, int scaleX, int scaleY);

Draws string text on screen using color. Top left of the text starts at upperLeft, this is a position in world space. The text is still rendered in 2D. scaleX and scaleY resize the text, this is NOT the size in pixels.


Renderer::Clear();

Removes all currently stored draw instructions.

Example

rlbot::NamedRenderer renderer("test");
renderer.DrawString2D("Hello world!", rlbot::Color::green,
                      rlbot::flat::Vector3{10, 10, 0}, 4, 4);
renderer.FinishAndSend();
Clone this wiki locally