UI

Service UI

Provides functionality for drawing and interacting with in-game user interface elements.

krpc_error_t krpc_UI_StockCanvas(krpc_connection_t connection, krpc_UI_Canvas_t * result)

The stock UI canvas.

Game Scenes:All
krpc_error_t krpc_UI_AddCanvas(krpc_connection_t connection, krpc_UI_Canvas_t * result)

Add a new canvas.

Game Scenes:All

Note

If you want to add UI elements to KSPs stock UI canvas, use krpc_UI_StockCanvas().

krpc_error_t krpc_UI_Message(krpc_connection_t connection, const char * content, float duration, krpc_UI_MessagePosition_t position, const krpc_tuple_double_double_double_t * color, float size)

Display a message on the screen.

Parameters:
  • content – Message content.
  • duration – Duration before the message disappears, in seconds.
  • position – Position to display the message.
  • color – The color of the message.
  • size – Size of the message, differs per position.
Game Scenes:

All

Note

The message appears just like a stock message, for example quicksave or quickload messages.

krpc_error_t krpc_UI_Clear(krpc_connection_t connection, bool clientOnly)

Remove all user interface elements.

Parameters:
  • clientOnly – If true, only remove objects created by the calling client.
Game Scenes:

All

krpc_UI_MessagePosition_t

Message position.

KRPC_UI_MESSAGEPOSITION_TOPLEFT

Top left.

KRPC_UI_MESSAGEPOSITION_TOPCENTER

Top center.

KRPC_UI_MESSAGEPOSITION_TOPRIGHT

Top right.

KRPC_UI_MESSAGEPOSITION_BOTTOMCENTER

Bottom center.