.. default-domain:: java .. highlight:: java .. package:: krpc.client.services.RasterPropMonitor Display ======= .. type:: public class Display A screen page that a script draws, and whose button presses it answers. Obtained by calling :meth:`Monitor.getDisplay()` or :meth:`RasterPropMonitor.display(SpaceCenter.Vessel, String)`. .. note:: A monitor shows a display on a page whose handler is ``KRPCDisplay``. kRPC's optional Module Manager patch adds such a page, named ``krpc``, to every monitor. The content is kept while KSP builds the IVA again, but not saved with the game. .. method:: String getName() The name of the display, or ``null`` for a monitor's own display. :Game Scenes: Flight .. method:: String getText() .. method:: void setText(String value) The text of the display, in Raster Prop Monitor's page format. It can hold markup, such as ``[#ff0000]`` for a color, and a line can format variables, as in ``{0:F0} m $&$ ALTITUDE``. Raster Prop Monitor updates the variables as it draws. :Game Scenes: Flight .. method:: byte[] getImage() .. method:: void setImage(byte[] value) The background image of the display, drawn under the text and scaled to the screen, as a PNG or JPEG image. ``null`` for none. Throws an exception if the image does not decode. :Game Scenes: Flight .. method:: void clear() Clear the text and the image. :Game Scenes: Flight .. method:: boolean getShown() Whether a monitor shows the display now. :Game Scenes: Flight .. method:: krpc.client.Event buttonPressed(int id) An event that fires when a monitor showing the display has a button pressed. The event lasts until it is removed. :param int id: The button's index in :meth:`Monitor.getButtons()`. :Game Scenes: Flight .. method:: krpc.client.Event buttonReleased(int id) An event that fires when a monitor showing the display has a button released. The event lasts until it is removed. :param int id: The button's index in :meth:`Monitor.getButtons()`. :Game Scenes: Flight