UI#
- class UI#
Provides functionality for drawing and interacting with in-game user interface elements.
Note
For drawing 3D objects in the flight scene, see the Drawing service. User interface elements created by a client are removed when that client disconnects, and when the game scene changes. A client that needs its interface in more than one scene must create it again in each of them.
- Canvas AddCanvas ()#
Add a new canvas.
- Game Scenes:
All
Note
If you want to add UI elements to KSPs stock UI canvas, use
UI.StockCanvas.
- void Message (string content, float duration = 1.0f, MessagePosition position = MessagePosition.TopCenter, StdLib.ColorRGBA? color = null, float size = 2e+01f)#
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. If null, defaults to
new StdLib.ColorRGBA(1.0f, 0.92f, 0.016f, 1.0f).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.