API
Table of Contents
- Drawing
- addLine
- addDirection
- addPolygon
- addText
- clear
- lineRemove
- lineGetStart
- lineSetStart
- lineGetEnd
- lineSetEnd
- lineGetColor
- lineSetColor
- lineGetThickness
- lineSetThickness
- lineGetReferenceFrame
- lineSetReferenceFrame
- lineGetVisible
- lineSetVisible
- lineGetMaterial
- lineSetMaterial
- polygonRemove
- polygonGetVertices
- polygonSetVertices
- polygonGetColor
- polygonSetColor
- polygonGetThickness
- polygonSetThickness
- polygonGetReferenceFrame
- polygonSetReferenceFrame
- polygonGetVisible
- polygonSetVisible
- polygonGetMaterial
- polygonSetMaterial
- textStaticAvailableFonts
- textRemove
- textGetPosition
- textSetPosition
- textGetRotation
- textSetRotation
- textGetContent
- textSetContent
- textGetFont
- textSetFont
- textGetSize
- textSetSize
- textGetCharacterSize
- textSetCharacterSize
- textGetStyle
- textSetStyle
- textGetAlignment
- textSetAlignment
- textGetLineSpacing
- textSetLineSpacing
- textGetAnchor
- textSetAnchor
- textGetColor
- textSetColor
- textGetReferenceFrame
- textSetReferenceFrame
- textGetVisible
- textSetVisible
- textGetMaterial
- textSetMaterial
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.referenceFrameLong A long value representing the id for the SpaceCenter.ReferenceFramevisibleboolean Whether the line is visible.
Returns {call: Object, decode: 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.referenceFrameLong A long value representing the id for the SpaceCenter.ReferenceFramelengthnumber The length of the line.visibleboolean Whether the line is visible.
Returns {call: Object, decode: function}
addPolygon
Extends Drawing
Draw a polygon in the scene, defined by a list of vertices.
Parameters
verticesArray<{number, number, number}> Vertices of the polygon.referenceFrameLong A long value representing the id for the SpaceCenter.ReferenceFramevisibleboolean Whether the polygon is visible.
Returns {call: Object, decode: function}
addText
Extends Drawing
Draw text in the scene.
Parameters
textstring The string to draw.referenceFrameLong A long value representing the id for the SpaceCenter.ReferenceFrameposition{number, number, number} Position of the text.rotation{number, number, number, number} Rotation of the text, as a quaternion.visibleboolean Whether the text is visible.
Returns {call: Object, decode: function}
clear
Extends Drawing
Remove all objects being drawn.
Parameters
clientOnlyboolean If true, only remove objects created by the calling client.
Returns void
lineRemove
Extends Drawing
Remove the object.
Parameters
lineLong A long value representing the id for the Drawing.Line
Returns void
lineGetStart
Extends Drawing
Start position of the line.
Parameters
lineLong A long value representing the id for the Drawing.Line
Returns {call: Object, decode: function}
lineSetStart
Extends Drawing
Start position of the line.
Parameters
lineLong A long value representing the id for the Drawing.Linevalue{number, number, number}
Returns void
lineGetEnd
Extends Drawing
End position of the line.
Parameters
lineLong A long value representing the id for the Drawing.Line
Returns {call: Object, decode: function}
lineSetEnd
Extends Drawing
End position of the line.
Parameters
lineLong A long value representing the id for the Drawing.Linevalue{number, number, number}
Returns void
lineGetColor
Extends Drawing
Set the color
Parameters
lineLong A long value representing the id for the Drawing.Line
Returns {call: Object, decode: function}
lineSetColor
Extends Drawing
Set the color
Parameters
lineLong A long value representing the id for the Drawing.Linevalue{number, number, number}
Returns void
lineGetThickness
Extends Drawing
Set the thickness
Parameters
lineLong A long value representing the id for the Drawing.Line
Returns {call: Object, decode: function}
lineSetThickness
Extends Drawing
Set the thickness
Parameters
lineLong A long value representing the id for the Drawing.Linevaluenumber
Returns void
lineGetReferenceFrame
Extends Drawing
Reference frame for the positions of the object.
Parameters
lineLong A long value representing the id for the Drawing.Line
Returns {call: Object, decode: function}
lineSetReferenceFrame
Extends Drawing
Reference frame for the positions of the object.
Parameters
lineLong A long value representing the id for the Drawing.LinevalueLong A long value representing the id for the SpaceCenter.ReferenceFrame
Returns void
lineGetVisible
Extends Drawing
Whether the object is visible.
Parameters
lineLong A long value representing the id for the Drawing.Line
Returns {call: Object, decode: function}
lineSetVisible
Extends Drawing
Whether the object is visible.
Parameters
lineLong A long value representing the id for the Drawing.Linevalueboolean
Returns void
lineGetMaterial
Extends Drawing
Material used to render the object. Creates the material from a shader with the given name.
Parameters
lineLong A long value representing the id for the Drawing.Line
Returns {call: Object, decode: function}
lineSetMaterial
Extends Drawing
Material used to render the object. Creates the material from a shader with the given name.
Parameters
lineLong A long value representing the id for the Drawing.Linevaluestring
Returns void
polygonRemove
Extends Drawing
Remove the object.
Parameters
polygonLong A long value representing the id for the Drawing.Polygon
Returns void
polygonGetVertices
Extends Drawing
Vertices for the polygon.
Parameters
polygonLong A long value representing the id for the Drawing.Polygon
Returns {call: Object, decode: function}
polygonSetVertices
Extends Drawing
Vertices for the polygon.
Parameters
polygonLong A long value representing the id for the Drawing.PolygonvalueArray<{number, number, number}>
Returns void
polygonGetColor
Extends Drawing
Set the color
Parameters
polygonLong A long value representing the id for the Drawing.Polygon
Returns {call: Object, decode: function}
polygonSetColor
Extends Drawing
Set the color
Parameters
polygonLong A long value representing the id for the Drawing.Polygonvalue{number, number, number}
Returns void
polygonGetThickness
Extends Drawing
Set the thickness
Parameters
polygonLong A long value representing the id for the Drawing.Polygon
Returns {call: Object, decode: function}
polygonSetThickness
Extends Drawing
Set the thickness
Parameters
polygonLong A long value representing the id for the Drawing.Polygonvaluenumber
Returns void
polygonGetReferenceFrame
Extends Drawing
Reference frame for the positions of the object.
Parameters
polygonLong A long value representing the id for the Drawing.Polygon
Returns {call: Object, decode: function}
polygonSetReferenceFrame
Extends Drawing
Reference frame for the positions of the object.
Parameters
polygonLong A long value representing the id for the Drawing.PolygonvalueLong A long value representing the id for the SpaceCenter.ReferenceFrame
Returns void
polygonGetVisible
Extends Drawing
Whether the object is visible.
Parameters
polygonLong A long value representing the id for the Drawing.Polygon
Returns {call: Object, decode: function}
polygonSetVisible
Extends Drawing
Whether the object is visible.
Parameters
polygonLong A long value representing the id for the Drawing.Polygonvalueboolean
Returns void
polygonGetMaterial
Extends Drawing
Material used to render the object. Creates the material from a shader with the given name.
Parameters
polygonLong A long value representing the id for the Drawing.Polygon
Returns {call: Object, decode: function}
polygonSetMaterial
Extends Drawing
Material used to render the object. Creates the material from a shader with the given name.
Parameters
polygonLong A long value representing the id for the Drawing.Polygonvaluestring
Returns void
textStaticAvailableFonts
Extends Drawing
A list of all available fonts.
Returns {call: Object, decode: function}
textRemove
Extends Drawing
Remove the object.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns void
textGetPosition
Extends Drawing
Position of the text.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetPosition
Extends Drawing
Position of the text.
Parameters
textLong A long value representing the id for the Drawing.Textvalue{number, number, number}
Returns void
textGetRotation
Extends Drawing
Rotation of the text as a quaternion.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetRotation
Extends Drawing
Rotation of the text as a quaternion.
Parameters
textLong A long value representing the id for the Drawing.Textvalue{number, number, number, number}
Returns void
textGetContent
Extends Drawing
The text string
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetContent
Extends Drawing
The text string
Parameters
textLong A long value representing the id for the Drawing.Textvaluestring
Returns void
textGetFont
Extends Drawing
Name of the font
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetFont
Extends Drawing
Name of the font
Parameters
textLong A long value representing the id for the Drawing.Textvaluestring
Returns void
textGetSize
Extends Drawing
Font size.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetSize
Extends Drawing
Font size.
Parameters
textLong A long value representing the id for the Drawing.Textvaluenumber
Returns void
textGetCharacterSize
Extends Drawing
Character size.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetCharacterSize
Extends Drawing
Character size.
Parameters
textLong A long value representing the id for the Drawing.Textvaluenumber
Returns void
textGetStyle
Extends Drawing
Font style.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetStyle
Extends Drawing
Font style.
Parameters
textLong A long value representing the id for the Drawing.TextvalueLong A long value representing the id for the UI.FontStyle
Returns void
textGetAlignment
Extends Drawing
Alignment.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetAlignment
Extends Drawing
Alignment.
Parameters
textLong A long value representing the id for the Drawing.TextvalueLong A long value representing the id for the UI.TextAlignment
Returns void
textGetLineSpacing
Extends Drawing
Line spacing.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetLineSpacing
Extends Drawing
Line spacing.
Parameters
textLong A long value representing the id for the Drawing.Textvaluenumber
Returns void
textGetAnchor
Extends Drawing
Anchor.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetAnchor
Extends Drawing
Anchor.
Parameters
textLong A long value representing the id for the Drawing.TextvalueLong A long value representing the id for the UI.TextAnchor
Returns void
textGetColor
Extends Drawing
Set the color
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetColor
Extends Drawing
Set the color
Parameters
textLong A long value representing the id for the Drawing.Textvalue{number, number, number}
Returns void
textGetReferenceFrame
Extends Drawing
Reference frame for the positions of the object.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetReferenceFrame
Extends Drawing
Reference frame for the positions of the object.
Parameters
textLong A long value representing the id for the Drawing.TextvalueLong A long value representing the id for the SpaceCenter.ReferenceFrame
Returns void
textGetVisible
Extends Drawing
Whether the object is visible.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetVisible
Extends Drawing
Whether the object is visible.
Parameters
textLong A long value representing the id for the Drawing.Textvalueboolean
Returns void
textGetMaterial
Extends Drawing
Material used to render the object. Creates the material from a shader with the given name.
Parameters
textLong A long value representing the id for the Drawing.Text
Returns {call: Object, decode: function}
textSetMaterial
Extends Drawing
Material used to render the object. Creates the material from a shader with the given name.
Parameters
textLong A long value representing the id for the Drawing.Textvaluestring
Returns void