# API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [Drawing](#drawing)
-   [addLine](#addline)
-   [addDirection](#adddirection)
-   [addPolygon](#addpolygon)
-   [addText](#addtext)
-   [clear](#clear)
-   [lineRemove](#lineremove)
-   [lineGetStart](#linegetstart)
-   [lineSetStart](#linesetstart)
-   [lineGetEnd](#linegetend)
-   [lineSetEnd](#linesetend)
-   [lineGetColor](#linegetcolor)
-   [lineSetColor](#linesetcolor)
-   [lineGetThickness](#linegetthickness)
-   [lineSetThickness](#linesetthickness)
-   [lineGetReferenceFrame](#linegetreferenceframe)
-   [lineSetReferenceFrame](#linesetreferenceframe)
-   [lineGetVisible](#linegetvisible)
-   [lineSetVisible](#linesetvisible)
-   [lineGetMaterial](#linegetmaterial)
-   [lineSetMaterial](#linesetmaterial)
-   [polygonRemove](#polygonremove)
-   [polygonGetVertices](#polygongetvertices)
-   [polygonSetVertices](#polygonsetvertices)
-   [polygonGetColor](#polygongetcolor)
-   [polygonSetColor](#polygonsetcolor)
-   [polygonGetThickness](#polygongetthickness)
-   [polygonSetThickness](#polygonsetthickness)
-   [polygonGetReferenceFrame](#polygongetreferenceframe)
-   [polygonSetReferenceFrame](#polygonsetreferenceframe)
-   [polygonGetVisible](#polygongetvisible)
-   [polygonSetVisible](#polygonsetvisible)
-   [polygonGetMaterial](#polygongetmaterial)
-   [polygonSetMaterial](#polygonsetmaterial)
-   [textStaticAvailableFonts](#textstaticavailablefonts)
-   [textRemove](#textremove)
-   [textGetPosition](#textgetposition)
-   [textSetPosition](#textsetposition)
-   [textGetRotation](#textgetrotation)
-   [textSetRotation](#textsetrotation)
-   [textGetContent](#textgetcontent)
-   [textSetContent](#textsetcontent)
-   [textGetFont](#textgetfont)
-   [textSetFont](#textsetfont)
-   [textGetSize](#textgetsize)
-   [textSetSize](#textsetsize)
-   [textGetCharacterSize](#textgetcharactersize)
-   [textSetCharacterSize](#textsetcharactersize)
-   [textGetStyle](#textgetstyle)
-   [textSetStyle](#textsetstyle)
-   [textGetAlignment](#textgetalignment)
-   [textSetAlignment](#textsetalignment)
-   [textGetLineSpacing](#textgetlinespacing)
-   [textSetLineSpacing](#textsetlinespacing)
-   [textGetAnchor](#textgetanchor)
-   [textSetAnchor](#textsetanchor)
-   [textGetColor](#textgetcolor)
-   [textSetColor](#textsetcolor)
-   [textGetReferenceFrame](#textgetreferenceframe)
-   [textSetReferenceFrame](#textsetreferenceframe)
-   [textGetVisible](#textgetvisible)
-   [textSetVisible](#textsetvisible)
-   [textGetMaterial](#textgetmaterial)
-   [textSetMaterial](#textsetmaterial)

## Drawing

Provides functionality for drawing objects in the flight scene.
 For drawing and interacting with the user interface, see the UI service.

Returns **void** 

## addLine

**Extends Drawing**

Draw a line in the scene.

**Parameters**

-   `start` **{number, number, number}** Position of the start of the line.
-   `end` **{number, number, number}** Position of the end of the line.
-   `referenceFrame` **Long** A long value representing the id for the SpaceCenter.ReferenceFrame
-   `visible` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether the line is visible.

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## addDirection

**Extends Drawing**

Draw a direction vector in the scene, from the center of mass of the active vessel.

**Parameters**

-   `direction` **{number, number, number}** Direction to draw the line in.
-   `referenceFrame` **Long** A long value representing the id for the SpaceCenter.ReferenceFrame
-   `length` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The length of the line.
-   `visible` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether the line is visible.

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## addPolygon

**Extends Drawing**

Draw a polygon in the scene, defined by a list of vertices.

**Parameters**

-   `vertices` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;{number, number, number}>** Vertices of the polygon.
-   `referenceFrame` **Long** A long value representing the id for the SpaceCenter.ReferenceFrame
-   `visible` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether the polygon is visible.

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## addText

**Extends Drawing**

Draw text in the scene.

**Parameters**

-   `text` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The string to draw.
-   `referenceFrame` **Long** A long value representing the id for the SpaceCenter.ReferenceFrame
-   `position` **{number, number, number}** Position of the text.
-   `rotation` **{number, number, number, number}** Rotation of the text, as a quaternion.
-   `visible` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether the text is visible.

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## clear

**Extends Drawing**

Remove all objects being drawn.

**Parameters**

-   `clientOnly` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** If true, only remove objects created by the calling client.

Returns **void** 

## lineRemove

**Extends Drawing**

Remove the object.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line

Returns **void** 

## lineGetStart

**Extends Drawing**

Start position of the line.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## lineSetStart

**Extends Drawing**

Start position of the line.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line
-   `value` **{number, number, number}** 

Returns **void** 

## lineGetEnd

**Extends Drawing**

End position of the line.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## lineSetEnd

**Extends Drawing**

End position of the line.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line
-   `value` **{number, number, number}** 

Returns **void** 

## lineGetColor

**Extends Drawing**

Set the color

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## lineSetColor

**Extends Drawing**

Set the color

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line
-   `value` **{number, number, number}** 

Returns **void** 

## lineGetThickness

**Extends Drawing**

Set the thickness

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## lineSetThickness

**Extends Drawing**

Set the thickness

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line
-   `value` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 

Returns **void** 

## lineGetReferenceFrame

**Extends Drawing**

Reference frame for the positions of the object.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## lineSetReferenceFrame

**Extends Drawing**

Reference frame for the positions of the object.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line
-   `value` **Long** A long value representing the id for the SpaceCenter.ReferenceFrame

Returns **void** 

## lineGetVisible

**Extends Drawing**

Whether the object is visible.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## lineSetVisible

**Extends Drawing**

Whether the object is visible.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line
-   `value` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 

Returns **void** 

## lineGetMaterial

**Extends Drawing**

Material used to render the object.
Creates the material from a shader with the given name.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## lineSetMaterial

**Extends Drawing**

Material used to render the object.
Creates the material from a shader with the given name.

**Parameters**

-   `line` **Long** A long value representing the id for the Drawing.Line
-   `value` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 

Returns **void** 

## polygonRemove

**Extends Drawing**

Remove the object.

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon

Returns **void** 

## polygonGetVertices

**Extends Drawing**

Vertices for the polygon.

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## polygonSetVertices

**Extends Drawing**

Vertices for the polygon.

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon
-   `value` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;{number, number, number}>** 

Returns **void** 

## polygonGetColor

**Extends Drawing**

Set the color

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## polygonSetColor

**Extends Drawing**

Set the color

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon
-   `value` **{number, number, number}** 

Returns **void** 

## polygonGetThickness

**Extends Drawing**

Set the thickness

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## polygonSetThickness

**Extends Drawing**

Set the thickness

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon
-   `value` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 

Returns **void** 

## polygonGetReferenceFrame

**Extends Drawing**

Reference frame for the positions of the object.

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## polygonSetReferenceFrame

**Extends Drawing**

Reference frame for the positions of the object.

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon
-   `value` **Long** A long value representing the id for the SpaceCenter.ReferenceFrame

Returns **void** 

## polygonGetVisible

**Extends Drawing**

Whether the object is visible.

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## polygonSetVisible

**Extends Drawing**

Whether the object is visible.

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon
-   `value` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 

Returns **void** 

## polygonGetMaterial

**Extends Drawing**

Material used to render the object.
Creates the material from a shader with the given name.

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## polygonSetMaterial

**Extends Drawing**

Material used to render the object.
Creates the material from a shader with the given name.

**Parameters**

-   `polygon` **Long** A long value representing the id for the Drawing.Polygon
-   `value` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 

Returns **void** 

## textStaticAvailableFonts

**Extends Drawing**

A list of all available fonts.

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textRemove

**Extends Drawing**

Remove the object.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **void** 

## textGetPosition

**Extends Drawing**

Position of the text.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetPosition

**Extends Drawing**

Position of the text.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **{number, number, number}** 

Returns **void** 

## textGetRotation

**Extends Drawing**

Rotation of the text as a quaternion.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetRotation

**Extends Drawing**

Rotation of the text as a quaternion.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **{number, number, number, number}** 

Returns **void** 

## textGetContent

**Extends Drawing**

The text string

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetContent

**Extends Drawing**

The text string

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 

Returns **void** 

## textGetFont

**Extends Drawing**

Name of the font

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetFont

**Extends Drawing**

Name of the font

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 

Returns **void** 

## textGetSize

**Extends Drawing**

Font size.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetSize

**Extends Drawing**

Font size.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 

Returns **void** 

## textGetCharacterSize

**Extends Drawing**

Character size.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetCharacterSize

**Extends Drawing**

Character size.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 

Returns **void** 

## textGetStyle

**Extends Drawing**

Font style.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetStyle

**Extends Drawing**

Font style.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **Long** A long value representing the id for the UI.FontStyle

Returns **void** 

## textGetAlignment

**Extends Drawing**

Alignment.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetAlignment

**Extends Drawing**

Alignment.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **Long** A long value representing the id for the UI.TextAlignment

Returns **void** 

## textGetLineSpacing

**Extends Drawing**

Line spacing.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetLineSpacing

**Extends Drawing**

Line spacing.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 

Returns **void** 

## textGetAnchor

**Extends Drawing**

Anchor.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetAnchor

**Extends Drawing**

Anchor.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **Long** A long value representing the id for the UI.TextAnchor

Returns **void** 

## textGetColor

**Extends Drawing**

Set the color

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetColor

**Extends Drawing**

Set the color

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **{number, number, number}** 

Returns **void** 

## textGetReferenceFrame

**Extends Drawing**

Reference frame for the positions of the object.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetReferenceFrame

**Extends Drawing**

Reference frame for the positions of the object.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **Long** A long value representing the id for the SpaceCenter.ReferenceFrame

Returns **void** 

## textGetVisible

**Extends Drawing**

Whether the object is visible.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetVisible

**Extends Drawing**

Whether the object is visible.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 

Returns **void** 

## textGetMaterial

**Extends Drawing**

Material used to render the object.
Creates the material from a shader with the given name.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text

Returns **{call: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), decode: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)}** 

## textSetMaterial

**Extends Drawing**

Material used to render the object.
Creates the material from a shader with the given name.

**Parameters**

-   `text` **Long** A long value representing the id for the Drawing.Text
-   `value` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 

Returns **void** 
