krpc-node/documentation/drawing.md at master · eXigentCoder/krpc-node

API

Table of Contents

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 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.
  • referenceFrame Long A long value representing the id for the SpaceCenter.ReferenceFrame
  • length number The length of the line.
  • visible boolean 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

  • vertices Array<{number, number, number}> Vertices of the polygon.
  • referenceFrame Long A long value representing the id for the SpaceCenter.ReferenceFrame
  • visible boolean Whether the polygon is visible.

Returns {call: Object, decode: function}

addText

Extends Drawing

Draw text in the scene.

Parameters

  • text 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 Whether the text is visible.

Returns {call: Object, decode: function}

clear

Extends Drawing

Remove all objects being drawn.

Parameters

  • clientOnly 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, decode: 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, decode: 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, decode: 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, decode: function}

lineSetThickness

Extends Drawing

Set the thickness

Parameters

  • line Long A long value representing the id for the Drawing.Line
  • value 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, decode: 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, decode: function}

lineSetVisible

Extends Drawing

Whether the object is visible.

Parameters

  • line Long A long value representing the id for the Drawing.Line
  • value 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, decode: 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

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, decode: function}

polygonSetVertices

Extends Drawing

Vertices for the polygon.

Parameters

  • polygon Long A long value representing the id for the Drawing.Polygon
  • value Array<{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, decode: 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, decode: function}

polygonSetThickness

Extends Drawing

Set the thickness

Parameters

  • polygon Long A long value representing the id for the Drawing.Polygon
  • value 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, decode: 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, decode: function}

polygonSetVisible

Extends Drawing

Whether the object is visible.

Parameters

  • polygon Long A long value representing the id for the Drawing.Polygon
  • value 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, decode: 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

Returns void

textStaticAvailableFonts

Extends Drawing

A list of all available fonts.

Returns {call: Object, decode: 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, decode: 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, decode: 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, decode: function}

textSetContent

Extends Drawing

The text string

Parameters

  • text Long A long value representing the id for the Drawing.Text
  • value 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, decode: function}

textSetFont

Extends Drawing

Name of the font

Parameters

  • text Long A long value representing the id for the Drawing.Text
  • value string

Returns void

textGetSize

Extends Drawing

Font size.

Parameters

  • text Long A long value representing the id for the Drawing.Text

Returns {call: Object, decode: function}

textSetSize

Extends Drawing

Font size.

Parameters

  • text Long A long value representing the id for the Drawing.Text
  • value number

Returns void

textGetCharacterSize

Extends Drawing

Character size.

Parameters

  • text Long A long value representing the id for the Drawing.Text

Returns {call: Object, decode: function}

textSetCharacterSize

Extends Drawing

Character size.

Parameters

  • text Long A long value representing the id for the Drawing.Text
  • value number

Returns void

textGetStyle

Extends Drawing

Font style.

Parameters

  • text Long A long value representing the id for the Drawing.Text

Returns {call: Object, decode: 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, decode: 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, decode: function}

textSetLineSpacing

Extends Drawing

Line spacing.

Parameters

  • text Long A long value representing the id for the Drawing.Text
  • value number

Returns void

textGetAnchor

Extends Drawing

Anchor.

Parameters

  • text Long A long value representing the id for the Drawing.Text

Returns {call: Object, decode: 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, decode: 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, decode: 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, decode: function}

textSetVisible

Extends Drawing

Whether the object is visible.

Parameters

  • text Long A long value representing the id for the Drawing.Text
  • value 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, decode: 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

Returns void