Monitor#

class RasterPropMonitor.Monitor()#

A Raster Prop Monitor screen in an IVA, such as an MFD. Obtained by calling RasterPropMonitor.monitors().

Note

Raster Prop Monitor draws a monitor only while the player is in the IVA of its pod, or the IVA overlay is on. Reading another monitor’s text or image updates it, in any camera mode.

Monitor.getPart()#

The part the monitor is in.

Property:

Read-only, cannot be set

Return type:

SpaceCenter.Part

Game Scenes:

Flight

Monitor.getPropName()#

The name of the prop, e.g. RasterPropMonitorBasicMFD.

Property:

Read-only, cannot be set

Return type:

string

Game Scenes:

Flight

Monitor.getPages()#

The names of the pages, in the order of the prop’s configuration.

Property:

Read-only, cannot be set

Return type:

Array of string

Game Scenes:

Flight

Monitor.getActivePage()#
Monitor.setActivePage(value)#

Returns the name of the page the monitor shows, and sets it as a press of the page’s button does. Raster Prop Monitor can refuse the switch, or redirect it to another page, as the prop’s configuration sets. Throws an exception if the monitor has no page with the name.

Property:

Can be read or written

Return type:

string

Game Scenes:

Flight

Monitor.getButtons()#

The names of the monitor’s buttons, e.g. button_UP. A button’s index in this list is its identifier. A name is empty where the configuration leaves a gap.

Property:

Read-only, cannot be set

Return type:

Array of string

Game Scenes:

Flight

Note

These are the buttons that the active page handles. The buttons that select pages are not in the list.

Monitor.pressButton(id)#

Press and release a button, as the player does. The release is on the next frame. Throws an exception if the monitor has no button with the identifier.

Arguments:
Game Scenes:

Flight

Monitor.getPageButtons()#

The names of the prop’s buttons that select the monitor’s pages, e.g. buttonR1. A captured button is one of them.

Property:

Read-only, cannot be set

Return type:

Array of string

Game Scenes:

Flight

Monitor.pressPageButton(name)#

Press and release a page button, as the player does. The release is on the next frame. A captured button shows the page the script chose. Throws an exception if the button does not select the monitor’s pages.

Arguments:
Game Scenes:

Flight

Monitor.captureButton(name, page)#

Take a page button from Raster Prop Monitor. A press of the button then shows the given page, such as the krpc page of the monitor’s own display, in place of the pages Raster Prop Monitor assigns it, and fires RasterPropMonitor.Monitor.capturedButtonPressed(). The capture lasts while KSP builds the IVA again, but is not saved with the game. Throws an exception if the button does not select the monitor’s pages, or the monitor has no page with the name.

Arguments:
Game Scenes:

Flight

Monitor.releaseCapture(name)#

Give a captured page button back to Raster Prop Monitor.

Arguments:
  • name (string) – The name of the button.

Game Scenes:

Flight

Monitor.capturedButtonPressed(name)#

An event that fires when the player presses a captured page button. The event lasts until it is removed.

Arguments:
  • name (string) – The name of the button.

Return type:

Event

Game Scenes:

Flight

Monitor.getDisplay()#

The monitor’s own display, which its pages show when their KRPCDisplay handler names no display.

Property:

Read-only, cannot be set

Return type:

RasterPropMonitor.Display

Game Scenes:

Flight

Monitor.getScreenWidth()#

The width of the screen, in characters.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Monitor.getScreenHeight()#

The height of the screen, in lines.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Monitor.getScreenPixelWidth()#

The width of the screen, in pixels.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Monitor.getScreenPixelHeight()#

The height of the screen, in pixels.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Monitor.getLetterWidth()#

The width of a character, in pixels.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Monitor.getLetterHeight()#

The height of a character, in pixels.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Monitor.getDefaultColor()#

The color of text with no color tag, on the active page.

Property:

Read-only, cannot be set

Return type:

StdLib.ColorRGBA

Game Scenes:

Flight

Monitor.getText()#

The text of the active page, as the screen shows it: one line per screen line, holding the characters Raster Prop Monitor draws. The tags it draws nothing for, such as colors, are removed.

Property:

Read-only, cannot be set

Return type:

string

Game Scenes:

Flight

Monitor.getRawText()#

The text of the active page with its variables formatted, and Raster Prop Monitor’s markup kept: colors [#rrggbb] and [#rrggbbaa], nudges [@xN] and [@yN] in pixels, [hw] and [dw] for half and double width, [sup], [sub] and [fontN].

Property:

Read-only, cannot be set

Return type:

string

Game Scenes:

Flight

Note

The page’s text overlay, drawn over the text, is not included.

Monitor.getVariables()#

The names of the variables the active page shows, in the order of its text.

Property:

Read-only, cannot be set

Return type:

Array of string

Game Scenes:

Flight

Monitor.image([format[, quality]])#

The screen as an image, at RasterPropMonitor.Monitor.getScreenPixelWidth() by RasterPropMonitor.Monitor.getScreenPixelHeight() pixels.

Arguments:
  • format (StdLib.ImageFormat) – The format of the image. Defaults to StdLib.ImageFormat.png.

  • quality (number) – The quality of a JPEG image, from 1 to 100. Defaults to 75.

Returns:

The image data.

Return type:

Uint8Array

Game Scenes:

Flight