.. default-domain:: lua .. highlight:: lua .. currentmodule:: UI UI == .. module:: UI Provides functionality for drawing and interacting with in-game user interface elements. .. attribute:: stock_canvas: UI.Canvas The stock UI canvas. :Attribute: Read-only, cannot be set :rtype: :class:`UI.Canvas` .. staticmethod:: add_canvas() Add a new canvas. :rtype: :class:`UI.Canvas` .. note:: If you want to add UI elements to KSPs stock UI canvas, use :attr:`UI.stock_canvas`. .. staticmethod:: message(content, [duration = 1.0], [position = 1], [color = (1.0, 0.92, 0.016)], [size = 20.0]) Display a message on the screen. :param string content: Message content. :param number duration: Duration before the message disappears, in seconds. :param UI.MessagePosition position: Position to display the message. :param Tuple color: The color of the message. :param number size: Size of the message, differs per position. .. note:: The message appears just like a stock message, for example quicksave or quickload messages. .. staticmethod:: clear([client_only = False]) Remove all user interface elements. :param boolean client_only: If true, only remove objects created by the calling client. .. class:: MessagePosition Message position. .. data:: top_left Top left. .. data:: top_center Top center. .. data:: top_right Top right. .. data:: bottom_center Bottom center.