.. default-domain:: cpp .. highlight:: cpp .. namespace:: krpc::services::Drawing Drawing ======= .. namespace:: krpc::services .. class:: Drawing : public krpc::Service Provides functionality for drawing objects in the flight scene. .. function:: Drawing(krpc::Client* client) Construct an instance of this service. .. function:: Line add_line(std::tuple start, std::tuple end, SpaceCenter::ReferenceFrame reference_frame, bool visible = true) Draw a line in the scene. :Parameters: * **start** -- Position of the start of the line. * **end** -- Position of the end of the line. * **reference_frame** -- Reference frame that the positions are in. * **visible** -- Whether the line is visible. :Game Scenes: Flight .. function:: Line add_direction(std::tuple direction, SpaceCenter::ReferenceFrame reference_frame, float length = 10.0, bool visible = true) Draw a direction vector in the scene, starting from the origin of the given reference frame. :Parameters: * **direction** -- Direction to draw the line in. * **reference_frame** -- Reference frame that the direction is in and defines the start position. * **length** -- The length of the line. * **visible** -- Whether the line is visible. :Game Scenes: Flight .. function:: Line add_direction_from_com(std::tuple direction, SpaceCenter::ReferenceFrame reference_frame, float length = 10.0, bool visible = true) Draw a direction vector in the scene, from the center of mass of the active vessel. :Parameters: * **direction** -- Direction to draw the line in. * **reference_frame** -- Reference frame that the direction is in. * **length** -- The length of the line. * **visible** -- Whether the line is visible. :Game Scenes: Flight .. function:: Polygon add_polygon(std::vector> vertices, SpaceCenter::ReferenceFrame reference_frame, bool visible = true) Draw a polygon in the scene, defined by a list of vertices. :Parameters: * **vertices** -- Vertices of the polygon. * **reference_frame** -- Reference frame that the vertices are in. * **visible** -- Whether the polygon is visible. :Game Scenes: Flight .. function:: Text add_text(std::string text, SpaceCenter::ReferenceFrame reference_frame, std::tuple position, std::tuple rotation, bool visible = true) Draw text in the scene. :Parameters: * **text** -- The string to draw. * **reference_frame** -- Reference frame that the text position is in. * **position** -- Position of the text. * **rotation** -- Rotation of the text, as a quaternion. * **visible** -- Whether the text is visible. :Game Scenes: Flight .. function:: void clear(bool client_only = false) Remove all objects being drawn. :Parameters: * **client_only** -- If true, only remove objects created by the calling client. :Game Scenes: Flight