Panel#

type krpc_UI_Panel_t#

A container for user interface elements. Added to a krpc_UI_Canvas_t or another panel.

krpc_error_t krpc_UI_Panel_RectTransform(krpc_connection_t connection, krpc_UI_RectTransform_t *returnValue, krpc_UI_Panel_t instance)#

The rect transform for the UI object.

krpc_error_t krpc_UI_Panel_LayoutElement(krpc_connection_t connection, krpc_UI_LayoutElement_t *returnValue, krpc_UI_Panel_t instance)#

How much space the UI object asks a layout for.

Note

Only has an effect when the object is in a panel that has a layout. A canvas is not inside a layout and does not have one.

krpc_error_t krpc_UI_Panel_Style(krpc_connection_t connection, krpc_UI_PanelStyle_t *returnValue, krpc_UI_Panel_t instance)#
krpc_error_t krpc_UI_Panel_set_Style(krpc_connection_t connection, krpc_UI_Panel_t instance, krpc_UI_PanelStyle_t value)#

How the background of the panel is drawn. A box is the frame to group related controls in, and is how a group box is made.

krpc_error_t krpc_UI_Panel_Color(krpc_connection_t connection, krpc_StdLib_ColorRGBA_t *returnValue, krpc_UI_Panel_t instance)#
krpc_error_t krpc_UI_Panel_set_Color(krpc_connection_t connection, krpc_UI_Panel_t instance, const krpc_StdLib_ColorRGBA_t *value)#

The color the background of the panel is tinted with.

Note

Has no effect while the style of the panel is KRPC_UI_PANELSTYLE_NONE, as the panel is then not drawn at all.

krpc_error_t krpc_UI_Panel_Draggable(krpc_connection_t connection, bool *returnValue, krpc_UI_Panel_t instance)#
krpc_error_t krpc_UI_Panel_set_Draggable(krpc_connection_t connection, krpc_UI_Panel_t instance, bool value)#

Whether the user can move the panel by dragging it.

Note

Dragging anywhere on the panel moves it, including over the elements it contains, unless one of them takes the pointer for itself. Give a panel a title bar of its own if only part of it should move it. A panel whose style is KRPC_UI_PANELSTYLE_NONE is not drawn, so it takes no pointer events of its own and can only be dragged by the elements it contains.

krpc_error_t krpc_UI_Panel_Visible(krpc_connection_t connection, bool *returnValue, krpc_UI_Panel_t instance)#
krpc_error_t krpc_UI_Panel_set_Visible(krpc_connection_t connection, krpc_UI_Panel_t instance, bool value)#

Whether the UI object is visible.

Note

This is the object’s own setting, which is what it was last set to. An object is only drawn when everything it is inside is visible as well, so an interface can be built with its parts visible, inside a panel that is not, and shown all at once by making that panel visible.

krpc_error_t krpc_UI_Panel_AddPanel(krpc_connection_t connection, krpc_UI_Panel_t *returnValue, krpc_UI_Panel_t instance, bool visible)#

Create a panel within this object.

Parameters:
  • visible – Whether the new panel is visible.

krpc_error_t krpc_UI_Panel_AddText(krpc_connection_t connection, krpc_UI_Text_t *returnValue, krpc_UI_Panel_t instance, const char *content, bool visible)#

Add text to this object.

Parameters:
  • content – The text.

  • visible – Whether the text is visible.

krpc_error_t krpc_UI_Panel_AddInputField(krpc_connection_t connection, krpc_UI_InputField_t *returnValue, krpc_UI_Panel_t instance, bool visible)#

Add an input field to this object.

Parameters:
  • visible – Whether the input field is visible.

krpc_error_t krpc_UI_Panel_AddButton(krpc_connection_t connection, krpc_UI_Button_t *returnValue, krpc_UI_Panel_t instance, const char *content, bool visible)#

Add a button to this object.

Parameters:
  • content – The label for the button.

  • visible – Whether the button is visible.

krpc_error_t krpc_UI_Panel_AddToggle(krpc_connection_t connection, krpc_UI_Toggle_t *returnValue, krpc_UI_Panel_t instance, const char *content, bool visible)#

Add a toggle to this object.

Parameters:
  • content – The label for the toggle.

  • visible – Whether the toggle is visible.

krpc_error_t krpc_UI_Panel_AddToggleGroup(krpc_connection_t connection, krpc_UI_ToggleGroup_t *returnValue, krpc_UI_Panel_t instance)#

Add a toggle group to this object, to make a set of toggles into radio buttons.

Note

The group is not drawn and does not take up any space. The toggles that belong to it can be added anywhere.

krpc_error_t krpc_UI_Panel_AddSlider(krpc_connection_t connection, krpc_UI_Slider_t *returnValue, krpc_UI_Panel_t instance, bool vertical, bool visible)#

Add a slider to this object.

Parameters:
  • vertical – Whether the slider runs from bottom to top, rather than from left to right.

  • visible – Whether the slider is visible.

krpc_error_t krpc_UI_Panel_AddDropdown(krpc_connection_t connection, krpc_UI_Dropdown_t *returnValue, krpc_UI_Panel_t instance, bool visible)#

Add a dropdown to this object.

Parameters:
  • visible – Whether the dropdown is visible.

krpc_error_t krpc_UI_Panel_AddImage(krpc_connection_t connection, krpc_UI_Image_t *returnValue, krpc_UI_Panel_t instance, bool visible)#

Add an image to this object.

Parameters:
  • visible – Whether the image is visible.

krpc_error_t krpc_UI_Panel_AddScrollView(krpc_connection_t connection, krpc_UI_ScrollView_t *returnValue, krpc_UI_Panel_t instance, bool visible)#

Add a scroll view to this object.

Parameters:
  • visible – Whether the scroll view is visible.

krpc_error_t krpc_UI_Panel_Layout(krpc_connection_t connection, krpc_UI_Layout_t *returnValue, krpc_UI_Panel_t instance)#

The layout that arranges the elements of the panel, or nullptr if they are positioned by hand.

krpc_error_t krpc_UI_Panel_AddHorizontalLayout(krpc_connection_t connection, krpc_UI_Layout_t *returnValue, krpc_UI_Panel_t instance)#

Arrange the elements of the panel in a row.

krpc_error_t krpc_UI_Panel_AddVerticalLayout(krpc_connection_t connection, krpc_UI_Layout_t *returnValue, krpc_UI_Panel_t instance)#

Arrange the elements of the panel in a column.

krpc_error_t krpc_UI_Panel_AddGridLayout(krpc_connection_t connection, krpc_UI_Layout_t *returnValue, krpc_UI_Panel_t instance)#

Arrange the elements of the panel in a grid of equally sized cells.

Note

The number of columns follows from the size of the panel and the size of a cell. Use krpc_UI_Layout_Constraint() to fix it instead.

krpc_error_t krpc_UI_Panel_SizeFitter(krpc_connection_t connection, krpc_UI_SizeFitter_t *returnValue, krpc_UI_Panel_t instance)#

Sizes the panel to fit what it contains.

Note

Both directions start out unconstrained, which leaves the size of the panel alone.

krpc_error_t krpc_UI_Panel_BringToFront(krpc_connection_t connection, krpc_UI_Panel_t instance)#

Draw the panel in front of the other elements beside it. Elements are drawn in the order they were added, so of two overlapping panels the newer hides part of the older until the older is brought to the front.

Note

A draggable panel also brings itself to the front when the user starts dragging it, the way a window comes to the front when it is clicked.

krpc_error_t krpc_UI_Panel_Remove(krpc_connection_t connection, krpc_UI_Panel_t instance)#

Remove the UI object.

type krpc_UI_PanelStyle_t#

How the background of a panel is drawn.

KRPC_UI_PANELSTYLE_WINDOW#

As a window, the heavier of the two frames the game uses.

KRPC_UI_PANELSTYLE_BOX#

As a box, the lighter frame the game groups related controls in.

KRPC_UI_PANELSTYLE_NONE#

Not drawn at all, leaving whatever is behind the panel showing through.